Lynxmotion HT1 - Servo Light Up but

Hi !!

I have to work on HT1 servo by Lynxmotion and my serial communication is good. I could drive the servo by UART2 on ESP32 WROOM but now i can’t.

When I try to comunicate with the servo by serial it do nothing. I send for exemple #0MD0200\r , I also try #0RESET\r and #0CONFIRM\r but I can see nothing.

When I power ON the servo I can see this sequence :
RED → YELLOW → GREEN → RED → LEDOFF

In the LSS button menu i can’t see the last red blink when power is ON, but i also try the factory reset but I didn’t see the red light at the end after confirm in the magenta pulse state.

Thanks you to taking time and explain to me what is the solution of my problem.

1 Like

@Evan_innowtech Welcome to the RobotShop commuity. We’re here to help. It sounds like you’re still able to communicate with the servo, so first guess it’s an issue with one or more settings. Some preliminary questions:

  1. To confirm, you have one HT1 servo and are communicating with it using an ESP32? No LSS Adapter or other Lynxmotion hardware?

  2. How are you powering the servo?

  3. Can you write a simple program to send D command to move the servo (at the right baud rate)?

  4. Following the button menu, can you ensure you’re in serial mode (as opposed to having accidentally changed to RC mode for example)? It should flash blue then green, and then you can hold to exit.

  5. It’s a bit harder to use an ESP32 to act as intermediary between a servo and the LSS Confirg software to check information and possibly update firmware. Do you have a serial to USB adapter?

2 Likes

Just in case you accidentally change the ID, can you try instead using #254[cmd]\r, where [cmd] is your command.
If you have only one LSS on the bus you can just try #254QID\r and see what response you get.

If you don’t get a response at all, maybe try different baud rates, too.

As @cbenson said, how you electrically power and connect your LSS to your ESP32 and/or PC/laptop will be important.

If you do not have a LSS Adapter or an independent USB<>UART adapter than you can most likely use the ESP32 as a temporary adapter to use the LSS Config. If that’s the case let us know and I can help figure that out, too! :slight_smile:

Side note: Keep in mind the ESP32’s GPIOs are most likely 3.3 V DC and the LSS bus uses 5 V DC. You may want to have voltage level translation (such as using my favourite one, RB-Spa-879) or other protection between the two. Personally, I typically due opto-isolation for serial comm with actuators and other “high power” devices (compared to a microcontroller, anyway).

Sincerely,

1 Like

Thank for your response !

I’m in LSS mode because the led blinking blue and green, I also see the power ON led routine but I see at last a red light and that is not “normal”.

I powering the servo with a power supply in 12V and my ESP32 is power on by USB with my computer.
I verify my UART communication and it is good, I also try to factory flash the servo but it did not work…

So I have tryed to send on id:254 and on all supported baud rate but that can’t work, except on 115200 when I see my MD command work but not like I want because I send every 2,5s #0MD0300\r and it does not have the desired behavior.

I don’t understand why I have that red light at the end of led routine when I power on the servo. And when I try to factory reset I don’t have the red light after magenta !

I suppose the servo have a problem because his configuration is not in the LSS button menu :frowning:

Thanks you to taking time and explain to me what is the solution of my problem !

1 Like

It sounds like it might be an issue with unrecognized code. If it does something at 115200, then that’s likely the correct baud rate, and if you didn’t change the ID, ID0 is also likely corrrect. If you get a red LED at the end of the startup routine, is there a chance you powered the ESP32 first such that it’s already sending commands to the servo, and then powered the servo so that immediately when it exits the startup routine, it receives an unrecognized command?

Can you share the sample code you are using to try to move the servo? It should be absolutely minimal. Watch for areas where you loop the serial command too quickly (ex. within your loop you write an MD command and the program loops after a few milliseconds… that would be weird).

2 Likes

That is my code :

/*
 * HT1 driver
 * ESP32 devkitc v4
 * https://www.innowtech.com/
 */
HardwareSerial mySerial2(2);

//  UART0
#define RXD0 3
#define TXD0 1

//  UART2
#define RXD2 16
#define TXD2 17
#define BR 115200

// Serial
byte cmd[]={0x23, 0x30, 0x4d, 0x44, 0x30, 0x34, 0x35, 0x30, 0x0D}; // 23 30 4d 44 30 34 35 30   #0MD0450\r
byte rst[]={0x23, 0x30, 0x52, 0x45, 0x53, 0x45, 0x54, 0x0D}; // 23 30 52 45 53 45 54   #0RESET\r
byte conf[]={0x23, 0x30, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x0D}; // 23 30 43 4f 4e 46 49 52 4d  #0CONFIRM\r
byte led[]={0x23, 0x30, 0x4c, 0x45, 0x44, 0x31, 0x0D};  // 23 30 4c 45 44 45 44 31  #0LED1\r

byte cmd_1[]={0x23, 0x32, 0x35, 0x34, 0x4d, 0x44, 0x30, 0x34, 0x35, 0x30, 0x0D}; // 23 30 4d 44 30 34 35 30   #254MD0450\r
byte rst_1[]={0x23, 0x32, 0x35, 0x34, 0x52, 0x45, 0x53, 0x45, 0x54, 0x0D}; // 23 30 52 45 53 45 54
byte conf_1[]={0x23, 0x32, 0x35, 0x34, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x0D}; // 23 32 35 34 43 4f 4e 46 49 52 4d
byte led_1[]={0x23, 0x32, 0x35, 0x34, 0x4c, 0x45, 0x44, 0x31, 0x0D};  // 23 32 35 34 4c 45 44 31

// Init
int cpt = 1;

void setup()
{
  // UART
  Serial.begin(115200);
  //Serial.begin(115200, SERIAL_8N1, RXD0, TXD0);   // set-up UART on GPIO 1 & 3 with 115 200 baud rate
  mySerial2.begin(BR, SERIAL_8N1, RXD2, TXD2);

  // BEGIN
  Serial.println("**** Program start****");
  Serial.printf("UART 2 : TX -> %u / RX -> %u / baud rate -> %u", TXD2, RXD2, BR);
  Serial.println();

  // RESET
  /*mySerial2.print("#0RESET\r");
  delay(50);
  mySerial2.print("#0CONFIRM\r");
  delay(1500);
  delay(950);
  */
  
  /*mySerial2.write(rst,8);
  delay(50);
  mySerial2.write(conf,10);
  delay(1250);*/
}


void loop()
{
  // 3x loop -> 3x cmd
  if(cpt < 4)
  {
      TestServo();
      cpt++;
  }
}

void TestServo()
{
  mySerial2.print("#254MD0450\r");
  delay(1000);
  
  /*
  mySerial2.write(cmd,9);
  delay(1000);
  */
}

I have powered the ESP32 at firt and before the servo power ON, so my ESP have probably sent messages before the end of startup routine. I try again the factory reset without TX and RX plugs to ESP32 and now I can see the red light at the end of factory reset but the blinking red light at the end of startup routine keep staying…

1 Like

Some initial ideas:

  1. The code to sending commands to the servo should be as easy as setting up the baud rate and sending a serial command. Try to get rid of as much as possible like printing stuff to the screen. Would need to check why all the rest of the code is there. Do you have a simple Arduino microcontroller you can use to test? There’s an LSS library which doesn’t need all of that extra code.
  2. The relative move command doesn’t need a 0 before… so a relative move of 45 degrees would be MD450.
  3. Rather than “mySerial2.print”, try “mySerial.prinln” (don’t need the \r at the end if you do).
  4. Can you modify the code slightly to have it move the servo based on, say, pressing any key on the keyboard?
2 Likes

Hi !

I have TTL/USB to communicate with the servo and I can connect it to LSS Config software. I tried to update the firmware in the recomanded version but after that I have a RED light and I can’t find the servo when I scan in LSS config software

Did it indicate that the firmware was updating? You can see the LED go purple and blue during the update process.
Once complete, you would manually select the COM port from the drop-down, and try a baud rate of 115200 and “Connect”.

It indicated that : “Firmware update completed successfully”, but the LED don’t go purple and blue it just off after yellow stop blinking with the recommended version and in the compatibility version the LED go blue and red and staying red.

In the recommended version I can see “completed successfully” but I can’t see the LED blinking and when I make a scan it detect nothing, it’s like a problem with the firmware stuck at the begenning

Which firmware did you update to?
After the firmware has finished updating, the LED would turn off.
It’s the “staying red” part which is odd. The only solid red would be the user selected LED color.

What is your RobotShop order or invoice number for this product?

Can you provide a few photos of the setup you are using when connected to the LSS Config?

It would be interesting to see if you have common ground between the servo, ESP32 and power supply.

1 Like

Ok now I think is good, the problem of ESP32 it’s the 3,3V logic and the servo need 5V logic in serial mode but sometimes 3,3V work as well. When I drove the servo with the ESP32 in 3,3V that worked as well but the problem appeared when I requested the servo with #0QD\r and wait a response.

Now I have flash the firmware with the LSS Config software and with the FTI232 in 5V mode and that working as well ! I need bidorectionnal TTL to up 3,3V to 5V and drive the HT1 servo with the ESP32.

Thanks you so much for your help and for the time you spent on my problem. You’ve helped a lot. Have a good Day !

1 Like

Ah, happy to hear! Good catch @scharette

3 Likes

You definitely want a voltage level translation here between the ESP32 and LSS bus. The 5 V DC signals from the LSS - assuming it doesn’t damage the ESP/2 / it tolerates 5 V DC coming in - should be ok, but the ESP32’s output will not count as high, only as low (when low) or “undefined/random” when high, since it only reaches 3.3 V DC.
This can definitely make it unreliable at best.

:+1:

See my comment above on the type of device that is low cost and easy to use for this:

Same to you and good luck with your project! :slight_smile:

2 Likes