ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board

More
3 years 8 months ago #265431 by TOLP2

[code]
net x-index-enable => pid.x.index-enable <= joint.0.index-enable => [LITEXCNC](NAME).encoder.00.index_enable
net x-enable      pid.x.enable  <= joint.0.amp-enable-out  => [LITEXCNC](NAME).stepgen.00.enable => [LITEXCNC](NAME).gpio.j11:1.out
        
net x-pos-cmd       joint.0.motor-pos-cmd => pid.x.command
net x-vel-fb        [LITEXCNC](NAME).encoder.00.velocity => pid.x.feedback-deriv
net axis.0.motor-pos-fb <= [LITEXCNC](NAME).encoder.00.position => pid.x.feedback
net x-output       pid.x.output => [LITEXCNC](NAME).stepgen.00.velocity-cmd
[code]
Is there a problem with the syntax of my encoder connection? I don't know whether there is a problem with my hal or my hardware connection
 
Could you please explain what you are trying to achieve. Without this, it is difficult to judge what the problem might be. Please:
  • add your machine config, so we can try to replicate your error;
  • give a description of what the machine should do;
  • give a description of what the machine is actually doing.
From what I can see from this code is that you are trying to 'close the loop'. You want to use an encoder as feedback and adjust based on this value. I think this is not something which can be done out-of-the-box. The reason is the way the communication is done:
  • T = 0 cycle: LinuxCNC reads the FPGA and thus encoder position, which is the current position;
  • T = 0.1 cycle:  LinuxCNC processes the information and determines how fast the motor should move to get to the wanted position;
  • T = 0.5 cycle: The data is then send to the FPGA, together with an apply time. From this timestamp the movement is started and this will be in the future;
  • T = 0.5 cycle: The FPGA processes the data, but is not moving yet as it awaits the apply time.
  • T = 0.9 cycle: The FPGA commands the steppers to move
  • T = 1.0 cycle: .... the process starts again.
When closing the loop one MUST take into account that the received position lags one full cycle behind commanded position. Because of this, the stepgen module also has the pin 'position-predicted', which makes a forecast where the stepper shall be. This pin has been created to give motmod  the feedback it requires. If you want to connect a stepper you would either:
  • have to close the loop in the FPGA;
  • have to make a module which can predicted the position at the start of the next cycle.
IMO: the first option would be the best.

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

More
3 years 8 months ago #265472 by wuyatom
I think the input of 5A-75E is connected to the encoder output interface of the servo driver to achieve full closed-loop control 

File Attachment:

File Name: file_0191eb5.hal
File Size:11 KB
 

File Attachment:

File Name: file_15cfcd5.ini
File Size:5 KB
 

File Attachment:

File Name: 5a-75e_v7....2-26.txt
File Size:5 KB

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

More
3 years 8 months ago #265508 by deroj

To run litexcnc in your poetry environment, please use:

sudo -E env PATH=$PATH poetry run litexcnc install_driver
 
Sorry...This doesn´t work either.
Code:
oj@VMLinuxCNC:~$ sudo -E env PATH=$PATH poetry run litexcnc install_driver [sudo] Passwort für oj:  /home/oj/src/litexcnc does not contain any element

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

More
3 years 8 months ago #265519 by TOLP2

I think the input of 5A-75E is connected to the encoder output interface of the servo driver to achieve full closed-loop control 

File Attachment:

File Name: file_0191eb5.hal
File Size:11 KB
 

File Attachment:

File Name: file_15cfcd5.ini
File Size:5 KB
 

File Attachment:

File Name: 5a-75e_v7....2-26.txt
File Size:5 KB
There is one thing missing in your HAL-file: you have to connect the feedback of the position to the motmod. The pin joint.N.motor-pos-fb is currently not connected in your HAL. This will cause joint following errors, because the motmod won't see your axis responding to the input.

If you don't use your encoders, you can connect it like this (see also [url] litex-cnc.readthedocs.io/en/latest/modules/stepgen.html [/url]):
Code:
net xpos-fb <= [LITEXCNC](NAME).stepgen.00.position_prediction net xpos-fb => joint.0.motor-pos-fb
 When you want to close-the-loop with using the encoders, you have to find your way to get the information to back to motmod.

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

More
3 years 8 months ago #265520 by TOLP2

To run litexcnc in your poetry environment, please use:

sudo -E env PATH=$PATH poetry run litexcnc install_driver
 
Sorry...This doesn´t work either.
Code:
oj@VMLinuxCNC:~$ sudo -E env PATH=$PATH poetry run litexcnc install_driver [sudo] Passwort für oj:  /home/oj/src/litexcnc does not contain any element
 
This error is due to an error in your project. Can you share the location of you repository or a zip-file with your code, the I can correct the error for you.

Also...
I implemented the aforementioned improvements in Litex-CNC. When pulling the latest version from this GitHub branch  you can now load extra modules and directly connect to the FPGA, for example with:
Code:
loadrt extra_modules="toolerator" connections="eth:10.0.0.10:1234"

The above statement will load the extra module toolerator  and will connect to a FPGA using:
  • ethernet / etherbone protocol (this is the only supported protocol at this moment);
  • the ip-address 10.0.0.10 (adjust this to the value in your config json);
  • the port 1234 (when the port is 1234, this can be omitted, as 1234 is the default).
One step closer to releasing version 1.0.0 of LitexCNC

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

More
3 years 8 months ago #265523 by deroj
Don't think it is an error in my project because I did not add one.
I am just not familiar with poetry and/or your workflow

Deleted litexcnc from the python site-package folder.
Reinstalled it with pip (0.9.0a5)
Did the poetry add git+http://......
Then sudo ... poetry run litexcnc....

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

Moderators: PCW, jmelson
Time to create page: 1.230 seconds
Powered by Kunena Forum