UNO/CNC Rotator - Motors Don't Turn

Hello,

We are building a SatNOGS Rotator v3.1 with cnc shield with respect to Quartapounds SatNOGS Rotator. All of the electronic parts are tested, and they work well. However, there is a firmware issue which is not solved yet. Libraries are uploaded into the arduino correctly from here. When arduino gets power, motors start to turn. I think they are trying to reach their initial positions. After that, we are trying to send comments by hamlib(rotctl) and Gpredict. Actually both of them reads position of motors differently. They took comments and change angles. That change can easily followed from windows. In real, motors do not turn. Programs thought motors are turning but they aren’t. How do we solve this problem?

Thanks for your help!

UTAA - Astronomy Community

I wish I could help… it’s quite strange that it moves and controls the motors when you reset the arduino, but not when you send commands… I never had this issue. all I can say is… I’m trying to get a different version of software working right now too. mine works great with my setup, but it has the meridian pass issue. I am trying to get the meridian pass software working right now (so far without success)

Hi all,
this is my first post here. I’m making a SatNOGS Rotator as I’ve seen in
https://wiki.satnogs.org/SatNOGS_Arduino_Uno/CNC_Shield_Based_Rotator_Controller
and follow the instructions here

In summary I have the same issues like @UTAA-Astro and I can’t move my stepper motors neither ‘rotctl’ command neither GPredict. I haven’t any errors but nothing happens.

I launch the next command to start:

rotctld -m 202 -r /dev/ttyACM0 -s 9600 -T 127.0.0.1 -t 4533 -C timeout=500 -C retry=0 -vvvvvvvv > pause

And the results are:
rotctld, Hamlib 3.3
Report bugs to hamlib-developer@lists.sourceforge.net

    rot_init called
    initrots3_easycomm called
    rot_register (201)
    rot_register (202)
    rot_register (204)
    rot_token_lookup called
    rot_confparam_lookup called
    rot_set_conf called
    rot_confparam_lookup called
    rot_set_conf: timeout='500'
    frontrot_set_conf called
    rot_token_lookup called
    rot_confparam_lookup called
    rot_set_conf called
    rot_confparam_lookup called
    rot_set_conf: retry='0'
    frontrot_set_conf called
    rot_open called
    serial_open called
    serial_setup called
    rig_strstatus called
    Backend version: 0.4, Status: Beta

When I start GPredict and engadged to the rotor system, the next messages are added to the console:
Connection opened from localhost:55692
rotctl(d): p ‘’ ‘’ ‘’ ‘’
rot_get_position called
easycomm_rot_get_position called
easycomm_transaction called: AZ EL

serial_flush called
write_block called
write_block(): TX 7 bytes
0000    41 5a 20 45 4c 20 0a                                AZ EL .         
read_string called
read_string(): RX 18 characters
0000    41 5a 2d 31 38 34 2e 37 20 45 4c 2d 31 38 30 2e     AZ-184.7 EL-180.
0010    30 0a                                               0.              
easycomm_transaction read_string: AZ-184.7 EL-180.0

easycomm_rot_get_position got response: AZ-184.7 EL-180.0

rotctl(d): P '180,00' '45,00' '' ''
rot_set_position called
easycomm_rot_set_position called: 180.000000 45.000000
easycomm_transaction called: AZ180.0 EL45.0 UP000 XXX DN000 XXX

serial_flush called
write_block called
write_block(): TX 35 bytes
0000    41 5a 31 38 30 2e 30 20 45 4c 34 35 2e 30 20 55     AZ180.0 EL45.0 U
0010    50 30 30 30 20 58 58 58 20 44 4e 30 30 30 20 58     P000 XXX DN000 X
0020    58 58 0a                                            XX.             
rotctl(d): p '' '' '' ''
rot_get_position called
easycomm_rot_get_position called
easycomm_transaction called: AZ EL 

The only diference is I’m using DRV8825 drivers instead of A4988. All the hardware components are working fine as I’ve used them in a CNC control machine too without problems.

Any clues?
Thank you.

2 Likes

Hi again,
I modify my stepper_motor_controller.ino without success as follows:

#define SAMPLE_TIME        0.1   ///< Control loop in s
///#define RATIO              108    ///< Gear ratio of rotator gear box                                 default 54
#define RATIO              1
///#define MICROSTEP          8     ///< Set Microstep
#define MICROSTEP          1
#define MIN_PULSE_WIDTH    20    ///< In microsecond for AccelStepper
///#define MAX_SPEED          3200  ///< In steps/s, consider the microstep
#define MAX_SPEED          800
///#define MAX_ACCELERATION   1600  ///< In steps/s^2, consider the microstep
#define MAX_ACCELERATION   200
///#define SPR                1600L ///< Step Per Revolution, consider the microstep
#define SPR                200
#define MIN_M1_ANGLE       0     ///< Minimum angle of azimuth
#define MAX_M1_ANGLE       360   ///< Maximum angle of azimuth
#define MIN_M2_ANGLE       0     ///< Minimum angle of elevation
#define MAX_M2_ANGLE       180   ///< Maximum angle of elevation
#define DEFAULT_HOME_STATE LOW  ///< Change to LOW according to Home sensor
#define HOME_DELAY         12000 ///< Time for homing Deceleration in millisecond

Some commands I run
rotctl -m 202 -r /dev/ttyACM0 -s 9600 -t 10

Rotator command: \send_cmd GS
Reply: GS8


Rotator command: \send_cmd GE
Reply: GE4


Rotator command: \send_cmd PARK
Reply: AZ-275.4 EL-180.0


Rotator command: \send_cmd AZ23, EL12
Reply: 
Rotator command: \send_cmd VE
Reply: VESatNOGS-v2.2

I’d like to add any picture from my configuration but with my nowadays forum status I’m afraid I cannot.

Thanks.

1 Like

Hey! GS4 error code means that in homing operation the rotator didn’t find the endstops.

2 Likes

Thanks for the answer. But is it mandatory install any endstop? Where in the code could I disable them if I could?

Thanks.

1 Like

I add a couple of endstops to test (+X and +Y) without success. This is my build:

1 Like

The stepper motor drivers are connected in correct pin and are defined correct in firmware? When the controller is powered up press the endstops. Then communicate again with controller. :rocket:

1 Like

Nothing … Next I show the detailed connections:

I’ve connected X+ and Y+ endstops with green and black connectors as the picture shows.
The pin connectors are defined as original rotator_pins.h without changes:

/*!
* @file rotator_pins.h
*
* It is a header file for pin mapping.
*
* Licensed under the GPLv3
*
*/

#ifndef ROTATOR_PINS_H_
#define ROTATOR_PINS_H_

//#define M1IN1 10 ///< Motor 1 PWM pin
#define M1IN1 2 ///< Motor 1 PWM pin
#define M1IN2 5  ///< Motor 1 PWM pin
#define M1SF  7  ///< Motor 1 digital input, status flag for DC Motor Drivers
#define M1FB  A1 ///< Motor 1 analog input, current/load feedback for DC Motor Drivers

#define M2IN1 3 ///< Motor 2 PWM pin
#define M2IN2 6  ///< Motor 2 PWM pin
#define M2SF  7 ///< Motor 2 digital input, status flag for DC Motor Drivers
#define M2FB  A0 ///< Motor 2 analog input, current/load feedback for DC Motor Drivers

#define MOTOR_EN 8 ///< Digital output, to enable the motors

#define SW1 11 ///< Digital input, to read the status of end-stop for motor 1
#define SW2 9 ///< Digital input, to read the status of end-stop for motor 2

#define RS485_DIR 2 ///< Digital output, to set the direction of RS485 communication

#define SDA_PIN 3 ///< I2C data pin
#define SCL_PIN 4 ///< I2C clock pin

#define PIN12 12 ///< General purpose I/O pin
#define PIN13 13 ///< General purpose I/O pin
#define A2    A2 ///< General purpose I/O & analog pin
#define A3    A3 ///< General purpose I/O & analog pin

#endif /* ROTATOR_PINS_H_ */

Errors from rotctl are the same, GE4 and GS8.

Thanks.

1 Like

At the end of void setup() add this:

while(1){
stepper_az.moveTo(deg2step(90));
stepper_el.moveTo(deg2step(90));
stepper_az.run();
stepper_el.run();
}

The stepper motors must be moved to 90deg.

1 Like

The motors move 90 deg at first time but later nothing happens only motors are consuming power but don’t move.

1 Like

The stepper motor drivers are connected and defined correct.
Remove the previous block of code from void setup() and from rotctl send a command IP1 and IP2 to read the end-stops.

1 Like
rotctl -m 202 -r /dev/ttyACM1 -s 9600 -t 10

Rotator command: \send_cmd IP1
Reply: IP1,0


Rotator command: \send_cmd IP2
Reply: IP2,0
1 Like

When you push the end-stops read the same values.

1 Like

When I push X+ endstop I get

Rotator command: \send_cmd IP1
Reply: IP1,0

Rotator command: \send_cmd IP2
Reply: IP2,1

In other cases IP2,0 also when I push Y+ endstop.

1 Like

Stepper motors and end-stops are connected and defined correctly.
Either comment line 105 or push the end-stops before the controller
starts.

1 Like

Hi again,

commenting these lines now I can work with the stepper motors and I can move them into command line and GPredict. However I realize that motors are consuming even when they stopped so it’s not very effective.
When I push end-stops before the controller starts does nothing.
At all I see that I have to tune the end-stops a bit in the code.

Thanks very much for your help.

2 Likes

i have a problem, when i tray execute roctld.bat, it open, but immediatly this closes, i dont undestand the reazon why this happen