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

More
4 years 4 months ago #244709 by TOLP2
Best is to recompile the driver everytime there is a new commit. Changes in the firmware are often combined with a difference in driver.

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

More
4 years 4 months ago #244724 by muvideo
Tested in Linuxcnc 2.8.2 conf with one stepgen few outputs and 3 pwm, stepgen still not working, is responding with strange numbers on it's pins.

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

More
4 years 4 months ago - 4 years 4 months ago #244735 by TOLP2
I tested the firmware with the following configuration
Code:
{     "board_name": "test_PWM_GPIO",     "baseclass": "firmware.boards.ColorLight_5A_75E_V6_0",     "clock_frequency": 50000000,     "ethphy": {         "tx_delay": 0     },     "etherbone": {         "ip_address": "10.0.0.10",         "mac_address": "0x10e2d5000000"     },     "gpio_in": [         {"pin":"j12:0", "name": "optional_name_unique"}     ],     "gpio_out": [         {"pin": "j1:1"},         {"pin": "j1:5"}     ],     "pwm": [         {"pin": "j1:2"}     ],     "stepgen": [         {             "step_pin": "j2:1",             "dir_pin": "j2:5",             "soft_stop": true         },         {             "step_pin": "j3:1",             "dir_pin": "j3:5",             "soft_stop": true         },         {             "step_pin": "j4:1",             "dir_pin": "j4:5",             "soft_stop": true         }     ] }

With this configuration I can run tests on all three stepgens and the data is received correctly. I used the following hal-commands to test it:
Code:
# This file assumes that the firmware located in ../firmware/5a-75e-stepgen-test/ is loaded  # to the FPGA. The corresponding json-configuration is loacted in the ../../examples  # folder. Modify paths as required for your setup! # # USAGE: #    halrun -I test_Stepgen.hal loadrt litexcnc loadrt litexcnc_eth config_file="/home/litexcnc/5a-75e-stepgen-test.json" loadrt threads name1=test-thread period1=10000000 loadrt siggen # Add litexcnc and siggen to the thread addf test_PWM_GPIO.read test-thread addf siggen.0.update test-thread addf test_PWM_GPIO.write test-thread # Setup the watchdog setp test_PWM_GPIO.watchdog.timeout_ns 15000000 # Some basic setup for stepgen, based on a simple stepper with 200 steps per revolution # per revolution, could be a simple Polulu DRV8825 setp test_PWM_GPIO.stepgen.02.maxaccel       10.0 setp test_PWM_GPIO.stepgen.02.maxvel         100.0 setp test_PWM_GPIO.stepgen.02.position-scale 200 # Settings for a Leadshine DM542, with timing multiplied by a factor 2  setp test_PWM_GPIO.stepgen.02.steplen        5000 setp test_PWM_GPIO.stepgen.02.stepspace      5000 setp test_PWM_GPIO.stepgen.02.dir-hold-time  10000 setp test_PWM_GPIO.stepgen.02.dir-setup-time 10000 # Enable the stepgen and setp test_PWM_GPIO.stepgen.02.enable         1 # Create a siggen and connect the sinus-soidal signal to the position of the stepgen setp siggen.0.frequency 0.25 # net stepgen-pos siggen.0.square => test_PWM_GPIO.stepgen.02.position-cmd net stepgen-pos siggen.0.sine => test_PWM_GPIO.stepgen.02.position-cmd setp test_PWM_GPIO.stepgen.02.debug TRUE

As you can see, I run at fairly low frequency, because for ach period I print out the complete debug of the stepgen, which includes commanded position, received position, estimated position, etc. Those numbers look correct.

Is there a possibility that either the driver or the firmware is not the latest version? The latest commit hash-tag is  1d6e37e
Last edit: 4 years 4 months ago by TOLP2.
The following user(s) said Thank You: svb

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

More
4 years 4 months ago #244974 by svb
Hi All
In the Litex description of the board, I found the "serial" section, which seems to be responsible for RS 232 or similar interfaces. How would one use this functionality to control a spindle connected via RS 485? Right now I'm using USB Dongle USB-RS485. The scheme of the electronic part is drawn, how to bring the serial port to the contacts that are indicated in the description of the board (or to any others, as I understand it, it doesn’t matter which ones)

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

More
4 years 4 months ago #244987 by romanetz
Right now, this function is not implemented yet. In general, a FIFO is needed inside the board to maintain continuous transmission of serial data. Say, for 1 msec servo period and serial speed 921600, a FIFO must have capacity 115 bytes. Taking into account that Etherbone protocol is limited to 256 bytes for a single transaction and some amount of data is already occupied, I estimate that something around 1-2 Mbits/sec is achievable.
Also there are some parameters that aren't needed to be sent every servo period: pulse length, step length; they could be considered as constants for the application.

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

More
4 years 4 months ago #245025 by TOLP2
Also in Litex-CNC this is not implemented yet. I don't think it will be implemented this year, unless people want to contribute to the project. First I want to focus on getting my version working 100% reliable. At this moment the modules GPIO out, PWM and stepgen work perfectly fine. Muvideo reported errors with the GPIO in, which I haven;t been able to reproduce. Coming week I get a shipment of 74LVC245 chips, so I can also start experimenting with the inputs.

About creating some more space in the etherbone packet by setting some parameters as constants is interesting. I think the list will be limited to parameters of the stepgen. Does a write-once HAL param exist? Otherwise such a write-once behavior can wreak havoc if somebody is not aware of the effects....

With RS-485 it is also important to remember that for different VFD's there are different commands and thus drivers. Those drivers assume that they can write to /dev/serial## for sending commands. So, it does not only require extension of the ColorCNC / Litex-CNC, but also modification of the specific driver on the VFD. The structure of Litex-CNC would allow to create an 'on-board' driver, with only sending commands for spindle speed to the FPGA, where the FPGA will translate them to RS-485 commands. In Python is easy to define multiple drivers for the different brands of VFD's.

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

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