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

More
3 years 9 months ago - 3 years 9 months ago #263001 by wuyatom
  My emergency stop button can't be pressed
Last edit: 3 years 9 months ago by wuyatom.

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

More
3 years 9 months ago #263003 by wuyatom
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=6
        loadusr -W hal_manualtoolchange
        
        # 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 xvel_cmd 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.0.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.00.debug 1
        # - Connect velocity command
        net yvel_cmd 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 yenable 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.0.debug 1
        
        # STEPGEN
        # - Setup of timings
        setp [LITEXCNC](NAME).stepgen.02.position-scale   [JOINT_2]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.00.debug 1
        # - Connect velocity command
        net zvel_cmd pos2vel.2.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 zenable joint.2.amp-enable-out => [LITEXCNC](NAME).stepgen.02.enable
        
        #net estop-out  =>     [LITEXCNC](NAME).gpio.j1:8.out
        
        # toolchange setup
        net tool-change  iocontrol.0.tool-change =>      hal_manualtoolchange.change
        net tool-changed iocontrol.0.tool-changed =>     hal_manualtoolchange.changed
        net tool-number  iocontrol.0.tool-prep-number => hal_manualtoolchange.number
        net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
        
        
        
        
        
 

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

More
3 years 9 months ago #263016 by deroj
To find out you can open terminal and run "halrun".
then load the two modules with
loadrt litexcnc
loadrt litexcnc_eth config_file="/path/to/config.json"

after successfully loaded type
show pin

which gives you a list of all pins and their names

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

More
3 years 9 months ago #263029 by TOLP2
@wuyatom: please clarify what you mean with 'cannot press E-Stop'. Is this in the GUI, or is it a physical button?

In case of the GUI: I cannot help you as you are using Axis and I use GMOCCAPY.

If it is a physical button. In the HAL file you posted I don't see any input defined for the E-stop. If you have an input assigned to the E-Stop and it is still not running, please verify you've modified the buffers. The default buffers are output only!

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

More
3 years 9 months ago #263059 by wuyatom
  It may be that my 5A-75E7.1 does not support it, but my 5a-75b_ The firmware file bit generated by v7.0i12o14p6s6e6.json, I use your 5a-75e_ v6.0_ The firmware file generated by i24o26p6s6e6.json cannot ping the motherboard. I don't know why 

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

More
3 years 9 months ago #263060 by wuyatom
The above gui shows that external estop is enabled, and I have minimized hal

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

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