Pulse and Direction Signals Not Working

Moderators: TomKerekes, dynomotion

Post Reply
derwin2lee2
Posts: 1
Joined: Thu Jun 23, 2022 12:35 am

Pulse and Direction Signals Not Working

Post by derwin2lee2 » Thu Jun 23, 2022 1:10 am

Hi,

I'm having trouble getting the pulse and direction signals working on my machine. I have a CNC gantry router with clearpath motors. I am using CNC4PC C68 connector board on my Kflop to connect to the UCBB break out board which is also from CNC4PC. I can get the machine on, initialize and home it, but the enable won't turn on. Once the machine is done homing, it essentially does nothing. If I don't setup the motors in the c program, then I can use the kmotion software to toggle the enable. But when the c program includes the motor setup you can't use the software to force the enable on.

I attached my C program for Initializing. What am I doing wrong?

Thanks,
Derwin
Attachments
H2OReactor Init.c
(11.04 KiB) Downloaded 19 times

User avatar
TomKerekes
Posts: 1934
Joined: Mon Dec 04, 2017 1:49 am

Re: Pulse and Direction Signals Not Working

Post by TomKerekes » Thu Jun 23, 2022 1:22 am

I can get the machine on, initialize and home it, but the enable won't turn on.
How can you home the system without the Enable on? How are you Homing?
then I can use the kmotion software to toggle the enable
what bit is the Enable?

What is the state of the EStop input?

Anything printed on the Kmotion Console?
Regards,

Tom Kerekes
Dynomotion, Inc.

rvitarella
Posts: 2
Joined: Thu Jun 23, 2022 1:03 pm

Re: Pulse and Direction Signals Not Working

Post by rvitarella » Thu Jun 23, 2022 1:30 pm

How can you home the system without the Enable on? How are you Homing?
We are using Clearpath motors, and they are setup to home on enable. We have the motor enable signals grouped into 2 enables. The first is CN1_Out_1 36, and the second is CN1_Out_14 38.
what bit is the Enable?
#define CN1_Out_1 36
#define CN1_Out_14 38
What is the state of the EStop input?
#define CN1_In_10 0
shows the status of our e-stop and changes states properly.

We checked the actual i/o that are wired in without motors setup and could toggle using the i/o checkboxes in the kflop software. Once we loaded the init file that is attached with all the motor settings the kmotion console was displaying our printf lines. The problem that we were having is that the step, and direction signals weren't changing when the motors were configured. Our E-Stop/Enable i/o were both working correctly, however, once motors were setup we got out of e-stop, and the motors were enabled, however the step/dir signals didn't seem to get to the clearpath motor.

User avatar
TomKerekes
Posts: 1934
Joined: Mon Dec 04, 2017 1:49 am

Re: Pulse and Direction Signals Not Working

Post by TomKerekes » Thu Jun 23, 2022 7:59 pm

The problem that we were having is that the step, and direction signals weren't changing when the motors were configured.
How do you know this? Once the Outputs are configured as Step/Dir Outputs you won't be able to toggle them as GPIO on the Digital IO Screen. You won't be able to see the Step Pulses on the Digital IO screen as the pulses are very narrow. You should be able to se the Direction signal change if you move in both directions.

How are the Step/Dir signals wired?
Regards,

Tom Kerekes
Dynomotion, Inc.

rvitarella
Posts: 2
Joined: Thu Jun 23, 2022 1:03 pm

Re: Pulse and Direction Signals Not Working

Post by rvitarella » Thu Jun 23, 2022 8:30 pm

I was only trying to use the gpio screen when I had the motors unset in the kflop, and toggling the checkbox would change the dir, and/or step the motor. To check if the direction/pulse signals were getting sent I was using the motor teknic clearpath software (MSP), and the position command and direction weren't changing there once the motors were setup.

This machine was running before, but we just had breakout boards on the kflop pins without opto-isolators.
We added a breakout board (KFLOP Connector)
https://cnc4pc.com/kflop-connector-board.html

and an opto board (UCBB):
https://www.cnc4pc.com/ucbb-dual-port-b ... board.html

I have a theory that I may need to reverse the step/dir outputs with: PGA(STEP_PULSE_LENGTH_ADD)=32 + 0x80;

User avatar
TomKerekes
Posts: 1934
Joined: Mon Dec 04, 2017 1:49 am

Re: Pulse and Direction Signals Not Working

Post by TomKerekes » Thu Jun 23, 2022 10:54 pm

I think the UCBB is expecting TTL signals so select TTL output mode by adding 8 to the OutputChan0 value.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply