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

More
04 Jan 2023 14:52 #260930 by juergenmoser
Thank you very much! That would helps me a lot! When you have time it would be very nice when you can write the hal and ini file. I only need 3 Axes (X,Y,Z) 1 Input for home and 2 outputs for mist and flood and 1 pwm for spindle speed. I will also look at the example of the HAL file, so i can learn a little bit and try it out! ;)

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

More
04 Jan 2023 18:13 #260942 by juergenmoser
Sorry TOLP to disturb again. Ive Tried installing litexcnc and get this error:
Collecting litexcnc
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: pypi.org/simple/litexcnc/

Is there an solution?
Thanks
 

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

More
04 Jan 2023 18:35 - 04 Jan 2023 18:37 #260945 by TOLP2

Sorry TOLP to disturb again. Ive Tried installing litexcnc and get this error:
Collecting litexcnc
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: pypi.org/simple/litexcnc/

Is there an solution?
Thanks

This is because there is no 'official' release to pypi.org yet. To install the package you should use:
pip install --extra-index-url https://test.pypi.org/simple/ litexcnc[cli]

I think in my previous post I forgot the /simple/ part in the command. Will verify and change it there as well. Without this addition, Thanks for trying!
Last edit: 04 Jan 2023 18:37 by TOLP2. Reason: Add missing tag [cli]

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

More
04 Jan 2023 18:53 #260948 by TOLP2
For your use case, you can use the pre-made configurations on this documentation page. You should download the documentation for the version of the board you have. I would recommend the use of the 'named' version of the configuration over the 'indexed' one. Why? With the 'named' version all pin numbers will show up in the HAL with their name, i.e. J1:1 (which is thus pin 1 on connector 1).

For your HAL, I think the code below is a nice starting point:
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt litexcnc
loadrt litexcnc_eth config_file="[LITEXCNC]CONFIG_FILE"
loadrt pos2vel number=3

# Add the functions to the thread
addf [LITEXCNC](NAME).read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pos2vel.convert servo-thread
addf [LITEXCNC](NAME).write servo-thread

########################################################################
STEPGEN
########################################################################
# - timings (prevent re-calculation)
net pos2vel.period-s       <= [LITEXCNC](NAME).stepgen.period-s
net pos2vel.period-s-recip <= [LITEXCNC](NAME).stepgen.period-s-recip

STEPGEN - X-AXIS
########################################################################
# POS2VEL
# - position control
net xpos-fb  <= [LITEXCNC](NAME).stepgen.00.position_prediction
net xpos-fb  => joint.0.motor-pos-fb
net xpos-fb  => pos2vel.0.position-feedback
net xvel-fb  pos2vel.0.velocity-feedback <= [LITEXCNC](NAME).stepgen.00.velocity-prediction
net xpos-cmd pos2vel.0.position-cmd      <= joint.0.motor-pos-cmd
# - settings
setp pos2vel.0.max-acceleration [JOINT_0]STEPGEN_MAXACCEL
# setp pos2vel.0.debug 1

# STEPGEN
# - Setup of timings
setp [LITEXCNC](NAME).stepgen.00.position-scale   [JOINT_0]SCALE
setp [LITEXCNC](NAME).stepgen.00.steplen          5000
setp [LITEXCNC](NAME).stepgen.00.stepspace        5000
setp [LITEXCNC](NAME).stepgen.00.dir-hold-time    10000
setp [LITEXCNC](NAME).stepgen.00.dir-setup-time   10000
setp [LITEXCNC](NAME).stepgen.00.max-velocity     [JOINT_0]MAX_VELOCITY
setp [LITEXCNC](NAME).stepgen.00.max-acceleration [JOINT_0]STEPGEN_MAXACCEL
# setp [LITEXCNC](NAME).stepgen.00.debug 1
# - Connect velocity command
net  pos2vel.0.velocity-cmd => [LITEXCNC](NAME).stepgen.00.velocity-cmd
# - Set the acceleration to be used (NOTE: pos2vel has fixed acceleration)
setp [LITEXCNC](NAME).stepgen.00.acceleration-cmd [JOINT_0]STEPGEN_MAXACCEL
# - enable the drive
net xenable joint.0.amp-enable-out => [LITEXCNC](NAME).stepgen.00.enable

STEPGEN - Y-AXIS
########################################################################
# POS2VEL
# - position control
net ypos-fb  <= [LITEXCNC](NAME).stepgen.01.position_prediction
net ypos-fb  => joint.1.motor-pos-fb
net ypos-fb  => pos2vel.1.position-feedback
net yvel-fb  pos2vel.1.velocity-feedback <= [LITEXCNC](NAME).stepgen.01.velocity-prediction
net ypos-cmd pos2vel.1.position-cmd      <= joint.1.motor-pos-cmd
# - settings
setp pos2vel.1.max-acceleration [JOINT_1]STEPGEN_MAXACCEL
# setp pos2vel.1.debug 1

# STEPGEN
# - Setup of timings
setp [LITEXCNC](NAME).stepgen.01.position-scale   [JOINT_1]SCALE
setp [LITEXCNC](NAME).stepgen.01.steplen          5000
setp [LITEXCNC](NAME).stepgen.01.stepspace        5000
setp [LITEXCNC](NAME).stepgen.01.dir-hold-time    10000
setp [LITEXCNC](NAME).stepgen.01.dir-setup-time   10000
setp [LITEXCNC](NAME).stepgen.01.max-velocity     [JOINT_1]MAX_VELOCITY
setp [LITEXCNC](NAME).stepgen.01.max-acceleration [JOINT_1]STEPGEN_MAXACCEL
# setp [LITEXCNC](NAME).stepgen.01.debug 1
# - Connect velocity command
net  pos2vel.1.velocity-cmd => [LITEXCNC](NAME).stepgen.01.velocity-cmd
# - Set the acceleration to be used (NOTE: pos2vel has fixed acceleration)
setp [LITEXCNC](NAME).stepgen.01.acceleration-cmd [JOINT_1]STEPGEN_MAXACCEL
# - enable the drive
net xenable joint.1.amp-enable-out => [LITEXCNC](NAME).stepgen.01.enable

STEPGEN - Z-AXIS
########################################################################
# POS2VEL
# - position control
net zpos-fb  <= [LITEXCNC](NAME).stepgen.02.position_prediction
net zpos-fb  => joint.2.motor-pos-fb
net zpos-fb  => pos2vel.2.position-feedback
net zvel-fb  pos2vel.2.velocity-feedback <= [LITEXCNC](NAME).stepgen.02.velocity-prediction
net zpos-cmd pos2vel.2.position-cmd      <= joint.2.motor-pos-cmd
# - settings
setp pos2vel.2.max-acceleration [JOINT_2]STEPGEN_MAXACCEL
# setp pos2vel.2.debug 1

# STEPGEN
# - Setup of timings
setp [LITEXCNC](NAME).stepgen.02.position-scale   [JOINT_1]SCALE
setp [LITEXCNC](NAME).stepgen.02.steplen          5000
setp [LITEXCNC](NAME).stepgen.02.stepspace        5000
setp [LITEXCNC](NAME).stepgen.02.dir-hold-time    10000
setp [LITEXCNC](NAME).stepgen.02.dir-setup-time   10000
setp [LITEXCNC](NAME).stepgen.02.max-velocity     [JOINT_2]MAX_VELOCITY
setp [LITEXCNC](NAME).stepgen.02.max-acceleration [JOINT_2]STEPGEN_MAXACCEL
# setp [LITEXCNC](NAME).stepgen.02.debug 1
# - Connect velocity command
net  pos2vel.1.velocity-cmd => [LITEXCNC](NAME).stepgen.02.velocity-cmd
# - Set the acceleration to be used (NOTE: pos2vel has fixed acceleration)
setp [LITEXCNC](NAME).stepgen.02.acceleration-cmd [JOINT_2]STEPGEN_MAXACCEL
# - enable the drive
net xenable joint.2.amp-enable-out => [LITEXCNC](NAME).stepgen.02.enable

The above HAL-file needs a speciel section in the INI-file:
[...]

[LITEXCNC]
CONFIG_FILE=<path to your config file>
NAME=<name of the card from the config file>

A good tactic for getting this up and running is to use the standard step config to generate the structure and the basis for your HAL file. Then  you replace the stepgen with the part above and change the required settings.

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

More
04 Jan 2023 20:03 #260956 by juergenmoser
I´m Sorry but this link also not working.  I have put now to the test.pypi.org to firefox and I searching for litexcnc - tadaa - there it is - don`t know why.
So I downloaded the Source Distribution 
litexcnc-0.9.0a3.tar.gz


 

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

More
04 Jan 2023 20:18 - 04 Jan 2023 20:26 #260958 by TOLP2
Strange, can you please share your input and output from your command line, i.e.:
$ pip install --extra-index-url https://test.pypi.org/simple/ litexcnc[cli]
Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://test.pypi.org/simple/ Collecting litexcnc[cli]  
Downloading https://test-files.pythonhosted.org/packages/45/35/86d98714ca9f6eb2338866578aaf616a5a05118ee6c346d6bb77b4d0a406/litexcnc-0.9.0a3-py3-none-any.whl
(146 kB)      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 146.3/146.3 kB 753.4 kB/s eta 0:00:00

There are also some other possibilities:
  • you need Python 3.8 or higher. So if you have 3.7 installed, pip cannot find this version;
  • if you have Python 3.8, your might use pip3 depending on your system. The standard pip might default to Python 2.x version.
  • last resort: update pip (pip install -U pip)
I will check whether I can draft a release which also supports Python 3.7, because it is the last version which is in the older Debian repos.
Last edit: 04 Jan 2023 20:26 by TOLP2.

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

More
04 Jan 2023 20:49 #260961 by juergenmoser
So I think thats my problem - i have Python 3.7 installed.I Will update pip. How can I Upload to python 3.8? also when i try the command without pip3 and only pip the say I have only Python 2.7 Installed..

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

More
04 Jan 2023 20:59 #260963 by TOLP2
Checking at this moment whether it installs on Python 3.7. If it works, I'll directly release a new version.
The following user(s) said Thank You: juergenmoser

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

More
04 Jan 2023 21:17 #260965 by juergenmoser
cnc@debian:~$ pip3 install https://test-files.pythonhosted.org/packages/05/6c/6493aa81992f8fc84eeb2934bdc568b30791c529b40915bd272baa976455/litexcnc-0.9.0a3.tar.gz
Collecting https://test-files.pythonhosted.org/packages/05/6c/6493aa81992f8fc84eeb2934bdc568b30791c529b40915bd272baa976455/litexcnc-0.9.0a3.tar.gz
  Using cached https://test-files.pythonhosted.org/packages/05/6c/6493aa81992f8fc84eeb2934bdc568b30791c529b40915bd272baa976455/litexcnc-0.9.0a3.tar.gz
  Installing build dependencies ... done
litexcnc requires Python '>=3.8,<4.0' but the running Python is 3.7.3
cnc@debian:~$ python --version
Python 2.7.16
cnc@debian:~$ python3 --version
Python 3.8.16
cnc@debian:~$
Hmm i dont know whats the problem...

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

More
04 Jan 2023 21:29 #260968 by TOLP2
Seems like you have multiple python installations on your system. I just released alpha-4, which does support Python 3.7, so you should be able installing it with the first command.

If the python 3.7 installation is on path (which is assume to be, as pip3 is on path), the scripts like install_driver should work and you won;t have to bother with the Python version hell.
The following user(s) said Thank You: juergenmoser

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

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