- Posts: 225
- Thank you received: 178
ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
- TOLP2
- Offline
- Elite Member
-
Less
More
3 years 11 months ago #255830
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
I am interested. I saw in th downloads that the PDF with the schematics something went wrong with the export. Each page is shifted a little bit downwards in the margins, so the last pages are mostly blank.
Would be wonderful to have a sort of HAT for the 5A-75E with for example:
- 6 stepgens (with DIR, STEP, ENA and ALARM (input)) = >24 pins
- 6 PWM with 0 - 10 Volt ouput
- some GPIO - in (for limit switches, button encoders, etc). How many?
- some GPIO - out - how many do we need?
- 1 or two expansion slots for future developments (like MPG, LCD or sensors?
I finished the split between stepgen and pos2vel-converter. I will push that tonight, as I need to add the example how to connect is in the HAL. Runs smoother then ever before.
Would be wonderful to have a sort of HAT for the 5A-75E with for example:
- 6 stepgens (with DIR, STEP, ENA and ALARM (input)) = >24 pins
- 6 PWM with 0 - 10 Volt ouput
- some GPIO - in (for limit switches, button encoders, etc). How many?
- some GPIO - out - how many do we need?
- 1 or two expansion slots for future developments (like MPG, LCD or sensors?
I finished the split between stepgen and pos2vel-converter. I will push that tonight, as I need to add the example how to connect is in the HAL. Runs smoother then ever before.
The following user(s) said Thank You: tommylight
- TOLP2
- Offline
- Elite Member
-
Less
More
- Posts: 225
- Thank you received: 178
3 years 11 months ago - 3 years 11 months ago #255870
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
I pushed the separated stepgen and converter to my GitHub in the branch stepgen_improvement. To use this version, one must modify their HAL-file, below is an example for a single axis.
Edit:
I removed the known issues, as they are now solved in the driver. Also updated the example with the revised pins.
Code:
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=1
# 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_2]STEPGEN_MAXACCEL
# setp pos2vel.0.debug 1
# STEPGEN
# - Setup of timings
setp [LITEXCNC](NAME).stepgen.00.position-scale [JOINT_2]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_2]MAX_VELOCITY
setp [LITEXCNC](NAME).stepgen.00.max-acceleration [JOINT_2]STEPGEN_MAXACCEL
# setp [LITEXCNC](NAME).stepgen.00.debug 1
# - Connect velocity command
net xvel-cmd <= pos2vel.0.velocity-cmd
net xvel-cmd => [LITEXCNC](NAME).stepgen.00.velocity-cmd1
net xvel-cmd => [LITEXCNC](NAME).stepgen.00.velocity-cmd2
# - Set the acceleration to be used (NOTE: pos2vel has fixed acceleration)
setp [LITEXCNC](NAME).stepgen.00.acceleration-cmd1 [JOINT_2]STEPGEN_MAXACCEL
setp [LITEXCNC](NAME).stepgen.00.acceleration-cmd2 [JOINT_2]STEPGEN_MAXACCEL
# - enable the drive
net xenable joint.0.amp-enable-out => [LITEXCNC](NAME).stepgen.00.enable
########################################################################
[...]
[b]Installation[/b]
To install components, one has to compile three components with the command below (assuming your current working directory is ./driver):
[code]
sudo halcompile --install ./stepgen/pos2vel.c litexcnc.c litexcnc_eth.c
Edit:
I removed the known issues, as they are now solved in the driver. Also updated the example with the revised pins.
Last edit: 3 years 11 months ago by TOLP2. Reason: Update of the source code
- TOLP2
- Offline
- Elite Member
-
Less
More
- Posts: 225
- Thank you received: 178
3 years 11 months ago #255871
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
To create an I/O hat for the 5A-75E, I'm wondering whether somebody has:
- A CAD or GERBER-file with the precise locations of the headers of the FPGA controller board
- Some detailed pictures (or just IC numbers) of a MESA card. I'm really wondering how they buffer / isolate their in- and outputs.
The following user(s) said Thank You: tommylight
- wuyatom
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 0
3 years 11 months ago - 3 years 11 months ago #256042
by wuyatom
Replied by wuyatom on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
/
\
| |
| yosys -- Yosys Open SYnthesis Suite |
| |
| Copyright (C) 2012 - 2018 Clifford Wolf <clifford@clifford.at> |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted, provided that the above |
| copyright notice and this permission notice appear in all copies. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
\
/
Yosys 0.8 (git sha1 5706e90)
-- Executing script file `colorlight_5a_75e.ys' --
1. Executing Verilog-2005 frontend.
Parsing Verilog input from `/home/wuya/LiteX-CNC/5a-75e/gateware/colorlight_5a_75e.v' to AST representation.
Storing AST representation for module `$abstract\colorlight_5a_75e'.
Successfully finished Verilog frontend.
2. Executing ATTRMAP pass (move or copy attributes).
3. Executing SYNTH_ECP5 pass.
3.1. Executing Verilog-2005 frontend.
Parsing Verilog input from `/usr/bin/../share/yosys/ecp5/cells_sim.v' to AST representation.
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:409) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:410) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:411) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:412) is not recognized unless read_verilog is called with -sv!
Generating RTLIL representation for module `\LUT4'.
Generating RTLIL representation for module `\L6MUX21'.
Generating RTLIL representation for module `\CCU2C'.
Generating RTLIL representation for module `\TRELLIS_RAM16X2'.
Generating RTLIL representation for module `\PFUMX'.
Generating RTLIL representation for module `\TRELLIS_DPR16X4'.
Generating RTLIL representation for module `\DPR16X4C'.
Generating RTLIL representation for module `\LUT2'.
Generating RTLIL representation for module `\TRELLIS_FF'.
Generating RTLIL representation for module `\OBZ'.
Generating RTLIL representation for module `\IB'.
Generating RTLIL representation for module `\TRELLIS_IO'.
Generating RTLIL representation for module `\OB'.
Generating RTLIL representation for module `\BB'.
Generating RTLIL representation for module `\INV'.
Generating RTLIL representation for module `\TRELLIS_SLICE'.
Successfully finished Verilog frontend.
3.2. Executing HIERARCHY pass (managing design hierarchy).
3.3. Executing AST frontend in derive mode using pre-parsed AST for module `\colorlight_5a_75e'.
Generating RTLIL representation for module `\colorlight_5a_75e'.
3.3.1. Analyzing design hierarchy..
Top module: \colorlight_5a_75e
ERROR: Module `\IDDRX1F' referenced in module `\colorlight_5a_75e' in cell `\IDDRX1F_4' is not part of the design.
I got an error compiling the firmware, I don't know why
\
| |
| yosys -- Yosys Open SYnthesis Suite |
| |
| Copyright (C) 2012 - 2018 Clifford Wolf <clifford@clifford.at> |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted, provided that the above |
| copyright notice and this permission notice appear in all copies. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
\
/
Yosys 0.8 (git sha1 5706e90)
-- Executing script file `colorlight_5a_75e.ys' --
1. Executing Verilog-2005 frontend.
Parsing Verilog input from `/home/wuya/LiteX-CNC/5a-75e/gateware/colorlight_5a_75e.v' to AST representation.
Storing AST representation for module `$abstract\colorlight_5a_75e'.
Successfully finished Verilog frontend.
2. Executing ATTRMAP pass (move or copy attributes).
3. Executing SYNTH_ECP5 pass.
3.1. Executing Verilog-2005 frontend.
Parsing Verilog input from `/usr/bin/../share/yosys/ecp5/cells_sim.v' to AST representation.
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:409) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:410) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:411) is not recognized unless read_verilog is called with -sv!
Lexer warning: The SystemVerilog keyword `assert' (at /usr/bin/../share/yosys/ecp5/cells_sim.v:412) is not recognized unless read_verilog is called with -sv!
Generating RTLIL representation for module `\LUT4'.
Generating RTLIL representation for module `\L6MUX21'.
Generating RTLIL representation for module `\CCU2C'.
Generating RTLIL representation for module `\TRELLIS_RAM16X2'.
Generating RTLIL representation for module `\PFUMX'.
Generating RTLIL representation for module `\TRELLIS_DPR16X4'.
Generating RTLIL representation for module `\DPR16X4C'.
Generating RTLIL representation for module `\LUT2'.
Generating RTLIL representation for module `\TRELLIS_FF'.
Generating RTLIL representation for module `\OBZ'.
Generating RTLIL representation for module `\IB'.
Generating RTLIL representation for module `\TRELLIS_IO'.
Generating RTLIL representation for module `\OB'.
Generating RTLIL representation for module `\BB'.
Generating RTLIL representation for module `\INV'.
Generating RTLIL representation for module `\TRELLIS_SLICE'.
Successfully finished Verilog frontend.
3.2. Executing HIERARCHY pass (managing design hierarchy).
3.3. Executing AST frontend in derive mode using pre-parsed AST for module `\colorlight_5a_75e'.
Generating RTLIL representation for module `\colorlight_5a_75e'.
3.3.1. Analyzing design hierarchy..
Top module: \colorlight_5a_75e
ERROR: Module `\IDDRX1F' referenced in module `\colorlight_5a_75e' in cell `\IDDRX1F_4' is not part of the design.
I got an error compiling the firmware, I don't know why
Last edit: 3 years 11 months ago by wuyatom.
- TOLP2
- Offline
- Elite Member
-
Less
More
- Posts: 225
- Thank you received: 178
3 years 11 months ago #256052
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Please share:
- the version of Litex.
- the branch of Litex-CNC you have used. The current branch with the latest updates is 'stepgen_improvement'.
- your configuration file used to create the bit-file.
- the type and make of your Led card, maybe it is the wrong type or you've found an incompatible version. The tool Yosys is only for Lattice ECP FPGA's and not for the RV901 which has a Spartan chipset.
For readability of the forum, please use the code tags to include the log on the forum.
- the version of Litex.
- the branch of Litex-CNC you have used. The current branch with the latest updates is 'stepgen_improvement'.
- your configuration file used to create the bit-file.
- the type and make of your Led card, maybe it is the wrong type or you've found an incompatible version. The tool Yosys is only for Lattice ECP FPGA's and not for the RV901 which has a Spartan chipset.
For readability of the forum, please use the code tags to include the log on the forum.
- wuyatom
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 0
3 years 11 months ago #256053
by wuyatom
Replied by wuyatom on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
mkdir LiteX
cd LiteX
wget raw.githubusercontent.com/enjoy-digital/...aster/litex_setup.py
python3 litex_setup.py --init --install --config=standard --gcc=riscv
git clone github.com/Peter-van-Tol/LiteX-CNC.git
install yosys
wget github.com/YosysHQ/oss-cad-suite-build/r...nux-x64-20220227.tgz && \
tar -xvf oss-cad-suite-linux-x64-20220227.tgz -C /opt/ && \
rm oss-cad-suite-linux-x64-20220227.tgz && \
echo '# set PATH so it includes oss-cad-suite' >> /etc/profile && \
echo 'if [ -d "/opt/oss-cad-suite/bin" ] ; then' >> /etc/profile && \
echo 'PATH="/opt/oss-cad-suite/bin:$PATH"' >> /etc/profile && \
echo 'fi' >> /etc/profile
5A-75E colorlight used,Command python3 -m firmware examples/5a-75e.json
cd LiteX
wget raw.githubusercontent.com/enjoy-digital/...aster/litex_setup.py
python3 litex_setup.py --init --install --config=standard --gcc=riscv
git clone github.com/Peter-van-Tol/LiteX-CNC.git
install yosys
wget github.com/YosysHQ/oss-cad-suite-build/r...nux-x64-20220227.tgz && \
tar -xvf oss-cad-suite-linux-x64-20220227.tgz -C /opt/ && \
rm oss-cad-suite-linux-x64-20220227.tgz && \
echo '# set PATH so it includes oss-cad-suite' >> /etc/profile && \
echo 'if [ -d "/opt/oss-cad-suite/bin" ] ; then' >> /etc/profile && \
echo 'PATH="/opt/oss-cad-suite/bin:$PATH"' >> /etc/profile && \
echo 'fi' >> /etc/profile
5A-75E colorlight used,Command python3 -m firmware examples/5a-75e.json
Moderators: PCW, jmelson
Time to create page: 0.397 seconds