Problem with TMCM1290EVAL BOARD and HOMING with sensor

plif

Oct 10, 2025
2
Joined
Oct 10, 2025
Messages
2
Hello,
I'm using a TMCM 1290 EVAL board hooked up to a stepper motor and a photointerrupter (GP1S093HCZ0F). Currently running into a problem with my sensor (GP1S093HCZ0F) and home position for the stepper motor I'm using.

The motor works perfectly, but I’m having trouble getting the sensor to interact with the motor. The sensor detects light at a single position, which should serve as the home position. Currently, the sensor itself works, but the motor does not respond when the sensor is activated.

The phototransistor is connected to the REF. SWITCHES input (also tried connecting to the GPIO pin). I connected the cathode and emitter to GND, placed a resistor (250Ohm) between the supply (5V) and the anode, and left the REF input connected to the collector. The board has a 4.7 kΩ pull-up resistor for the left REF input.

I tested by manually shorting LEFT REF to GND, which successfully triggered a logic low and caused the motor to respond to the TMCL code. However, this does not happen with the phototransistor connected.

Using a voltmeter, I measured 0.8 V between GND and the collector when light is detected, which the driver interprets as low, and 5 V when the light is off.

Is it possible that it's a programming problem too? I've been testing with this code from the examples. Tried this with the GPIO pins:
Code:
Code:
amax = 10000           // max acceleration
vmax = 20000           // max speed
cmax = 100             // max current


SAP 5, 0, amax         // set max acceleration
SAP 6, 0, cmax         // set max current

SGP 78, 0, 0              // configure GPIO0 as input (bit 0 = 0)
SIO 0, 0, 1            // enable internal pull-up for input 0 (optional)


loop:
    GIO 0, 0           // read GPIO0 into accumulator
    JC ZE, stopMotor   // if LOW → photointerruptor active → stop motor

    // Sensor inactive → rotate left
    ROL 0, vmax        // rotate axis 0 at vmax
    JA loop            // repeat loop

stopMotor:
    MST 0              // stop motor immediately
    JA loop            // go back to loop
Also the schematics:
1760104538208.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,270
Joined
Nov 17, 2011
Messages
14,270
Is it possible that it's a programming problem too?
Unlikely. In that case the program wouldn't recognize the manual short either.
Using a voltmeter, I measured 0.8 V between GND and the collector when light is detected, which the driver interprets as low, and 5 V when the light is off.
That's what one would expect. How does the motor interact with the photosensor. I'd expect a kind of shutter mechanism to block the light path when the motor reaches a defined position. Could it be that this shutter or optical interruptor doesn't block the light enough such that the output of the sensor stays low all the time?
 

plif

Oct 10, 2025
2
Joined
Oct 10, 2025
Messages
2
Unlikely. In that case the program wouldn't recognize the manual short either.

That's what one would expect. How does the motor interact with the photosensor. I'd expect a kind of shutter mechanism to block the light path when the motor reaches a defined position. Could it be that this shutter or optical interruptor doesn't block the light enough such that the output of the sensor stays low all the time?
About the interaction, I place it in this 'hole' where inside, when the motor moves, there is a round mechanism, that moves together around with the motor, which has a split in it, so when the split moves through the optotrans, it detects there is light. The mechanism itself works, because I added a LED between left ref the opto-trans that lights up, when the split is reached.
 

JameStronic

Oct 16, 2025
7
Joined
Oct 16, 2025
Messages
7
It looks like your mechanism is working since the LED lights up when the split passes. The issue might be with the TMCM-1290 homing setup or sensor input configuration. I’d check the board’s input settings and maybe monitor the sensor signal directly to see if the board detects it. What homing method are you using in your code?
 

jj_parkar95

Jan 1, 2026
8
Joined
Jan 1, 2026
Messages
8
Since the REF input responds correctly when manually pulled to GND, the issue is likely electrical rather than purely software. A collector voltage of ~0.8 V may not be low enough under load try using an open-collector configuration with the board’s internal pull-up only, increase the resistor value, or add a buffer/transistor stage to ensure a clean logic-low that the TMCM1290 reliably detects during homing.
 
Top