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

More
4 years 4 months ago - 4 years 4 months ago #245447 by TOLP2
I checked the HAL-file, but as far as I can see the position feedback is correctly connected to the stepgen, so something else has to go wrong.

I see that you already put the following code in your HAL-file:
Code:
setp [TOLP2](CARD0).stepgen.02.debug TRUE

Can you re-enable the code and copy the created output to the forum? To see the output, you have to start LinuxCNC from the command line, just by typing linuxcnc. Any output created from the debug will be printed to the output.It will help me to further pinpoint the cause of this behavior.
 
Furthermore I see that in the HAL-file, the order of adding functions to the thread can be optimized. Please, use the following order:
Code:
addf [TOLP2](CARD0).read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf [TOLP2](CARD0).write servo-thread

Above order means that the current state is read from the FPGA. The motion-controller can then determine the required state of the stepgens. Finally this desired state is written to the stepgen. The loop is nice and tight.
Last edit: 4 years 4 months ago by TOLP2.

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

More
4 years 4 months ago #245497 by TOLP2
Today I did my first SMD soldering and replaced one of the 74HCT245 with a 74LVC245 on my 5A-75E. The 74LVC245 is a 3.3 V buffer with 5V tolerant inputs, so it is suitable for input buffer. Required modifications:
  • cut traces supplying 5V to VCC (pin 20) and DIR (pin 1);
  • Connect VCC (pin 20) to a 3.3 V supply. I used a relative long jumper wire all the way to the JTAG point, where I know for sure it is available;
  • Connect DIR (pin1) to GND, this will make the buffer direction to be INPUT.I changed U28, which makes J1 an input.
Tested the firmware / driver with J1 as an input. Works like a charm with the pins reporting TRUE when connected to 3.3 V (sorry, didn't dare to test with 5V yet) and FALSE when disconnected or connected to GND.

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

More
4 years 4 months ago - 4 years 4 months ago #245508 by svb
Hi.
Changed configs and attach the logs.
TOLP2 based on a StepConf and has 3 axis config
TOLP2_mesa based on a PNConf and has 2 axis config

File Attachment:

File Name: TOLP2_mesa.tgz
File Size:5 KB

File Attachment:

File Name: TOLP2_mesa.txt
File Size:4 KB

File Attachment:

File Name: TOLP2.tgz
File Size:4 KB

File Attachment:

File Name: TOLP2.txt
File Size:3 KB


Video link for this test

 
Last edit: 4 years 4 months ago by svb.

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

More
4 years 4 months ago #245612 by svb
Dear Peter.
Can you share your .bit file and corresponding .json file?
I will try your file for checking my board. May be my board not work correctly.

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

More
4 years 4 months ago #245613 by svb
While E-stop active i see changed data on BOARD.stepgen.XX.position-feedback pin. After succsessfuly start linuxcnc BOARD.stepgen.XX.position-feedback pins not changed on all axes (have static numbers)

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

More
4 years 4 months ago - 4 years 4 months ago #246213 by TOLP2
After some frustrating nights I have found the solution why it didn't work in LinuxCNC with the stepgen. Please find the complete file attached to this post. 

Most important part of the changes are in bold:
Code:
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 [b]setp [LITEXCNC](NAME).stepgen.00.maxvel   [JOINT_0]MAX_VELOCITY[/b] setp [LITEXCNC](NAME).stepgen.00.maxaccel [JOINT_0]STEPGEN_MAXACCEL net xpos-cmd joint.0.motor-pos-cmd => [LITEXCNC](NAME).stepgen.00.position-cmd net xpos-fb [LITEXCNC](NAME).stepgen.00.[b]position_prediction [/b]=> joint.0.motor-pos-fb net xenable joint.0.amp-enable-out => [LITEXCNC](NAME).stepgen.00.enable

When the file is generated with stepconf the line defining the max velocity is not generated. Normally, the stepgen of LinuxCNC uses this value, but we cut this component out of the hal-file. So therefore we have to let the FPGA know (or better: the driver of the FPGA) what the limit of the machine is. When this parameter is not set the maxvel is 0 units/second. With other words: the machine won't move in this case.

Other change is that we use the position_prediction as position feedback for the joint. This is the speed the machine will be at when the next command is going to be executed. This gives a nice smooth behavior.

File Attachment:

File Name: mill_test.ini
File Size:2 KB

File Attachment:

File Name: mill_test.hal
File Size:4 KB
Last edit: 4 years 4 months ago by TOLP2. Reason: Added the promised files
The following user(s) said Thank You: besriworld, Pro_El, tuzki, svb

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

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