Connect with us

Programming a stepper motor with Picaxe

Discussion in 'Sensors and Actuators' started by Chaymoss, Aug 18, 2021.

Scroll to continue with content
  1. Chaymoss

    Chaymoss

    3
    0
    Aug 18, 2021
    Code:
    #picaxe 28x2
    main:
    let b1 = 0 ; set b1 value
    low B.2;
    low B.5;
    FOR b1 = 0 TO 1000
        high B.0 ; switch on output B.1
         pause 500 ; wait 0.5 seconds
         low B.0 ; switch on output B.1
         pause 500 ; wait 0.5 seconds
    NEXT b1  
    pause 1000; wait 1 seconds  
    high B.5;
    FOR b1 = 0 TO 1000
        high B.0 ; switch on output B.1
         pause 500 ; wait 0.5 seconds
         low B.0 ; switch on output B.1
         pause 500 ; wait 0.5 seconds
    NEXT b1
    pause 1000; wait 1 seconds
    goto main
    Hello,
    I need some help for programming the stepper motor "https://docs.rs-online.com/9cd2/0900766b813f0a12.pdf" with PICAXE-28X2 SHIELD BASE "https://picaxe.com/docs/axe401.pdf", the driver that I'm using is STEPPER 4 CLICK "https://www.digikey.at/htmldatasheets/production/2455715/0/0/1/mikroe-2748.html"
    The motor does not work.
    You can see the program above.
    Thank you in advance
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    11,702
    2,717
    Nov 17, 2011
    How is the stepper driver connected to the Picaxe shield (B.0, B.2, B.5)?
    What are the settings of the stepper driver?
    How is the stepper driver connected to the motor?
     
  3. Chaymoss

    Chaymoss

    3
    0
    Aug 18, 2021
    upload_2021-8-19_8-58-44.png
    As shown above in the pinout digram, I used B.2 to connect to ENABLE, B.0 connected to STEP trigger (PWM) and B.5 to DIRECTION, and RST connected to the reset of picaxe shield so I'm wondering if this is the right way to program the outputs pins in PICAXE Programming.
    I checked the electric circuit, everything is working right supposedly. However, I think the problem is in the programming, cause it's my first time I'm using the Picaxe shield, and I couldn't find programming examples that are compatible with PICAXE-28X2 for stepper motor control.
    upload_2021-8-19_9-30-0.png
     
    Last edited: Aug 19, 2021
  4. Sunnysky

    Sunnysky

    488
    126
    Jul 15, 2016
    Does the USB port work? I was impressed with my setup with open windows software Gcode Panel to an UNO with a $24 CNC shield on a 12V supply . Using gcode downloaded to UNO and Gcode Panel on a laptop. Watch out for motor supply ground noise if connected to an earth grounded tower interfering with USB port cable. Very nice User interface for XY control of acceleration, max speed and position recal with home switches. Uses touch jog buttons or user programmed Gcode files to run any pattern.
     
    Last edited: Aug 19, 2021
  5. Chaymoss

    Chaymoss

    3
    0
    Aug 18, 2021
    Thank you Sunnysky, I tested the USB port, the picaxe cable, and the Picaxe base shield, they are all working.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-