Error while trying to install

134 views
Skip to first unread message

wol aye

unread,
Sep 27, 2023, 9:24:41 AM9/27/23
to LINOROBOT
Hello All,
I have been trying to install LINOROBOT but I get an error after issuing the line of code below, please kindly help me to fix the issue.

Code:
bash install_linorobot2.bash <robot_type> <laser_sensor> <depth_sensor>

Error:
install_linorobot2.bash: line 150: syntax error near unexpected token 'echo'

wol aye

unread,
Oct 7, 2023, 12:17:07 PM10/7/23
to LINOROBOT
Dear All,
Please when I drive the electric motor with some code on Teensy 4.1, it moves fine, but when I connect it with raspberry pi 4, it detects Teensy but it is not moving the motor. Please does anyone have an Idea on what I can do?

--
You received this message because you are subscribed to the Google Groups "LINOROBOT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linorobot+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linorobot/f3cba4e1-202f-4971-8bc6-abda32575e73n%40googlegroups.com.

Az

unread,
Oct 8, 2023, 4:25:25 AM10/8/23
to LINOROBOT

wol aye

unread,
Oct 8, 2023, 10:43:51 AM10/8/23
to Az, LINOROBOT
Hello,
Thanks for the response.
Whenever I run this command: 

screen /dev/ttyACM0

It gives me an error: "screen terminating" and closes the screen session.

I am using brushless motor driver and scooter hub motor.


You received this message because you are subscribed to a topic in the Google Groups "LINOROBOT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linorobot/elXgKkabJ9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linorobot+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linorobot/a112dda3-687f-4c1b-a664-1a41b5367198n%40googlegroups.com.

Az

unread,
Oct 8, 2023, 11:07:27 AM10/8/23
to LINOROBOT
Interesting! I also use hub motors. Here's my github, https://github.com/otomoov/AutoMoveProgram 
I still don't know, what is causing the error. Perhaps redoing https://github.com/linorobot/linorobot2_hardware would solve the issue? Also would you mind sharing picture, video, wiring diagram of your build? I could give a look.

wol aye

unread,
Oct 13, 2023, 12:34:22 PM10/13/23
to Az, LINOROBOT
Hi, 
Thanks for showing the connection to your hub motors.
I am suspecting the BLDC controller (picture attached) I am using might be what is giving me the problem.
So I decided to purchase same controller as your's but I couldn't find enough documentation to the zs-x11H motor controller.
Please can I connect the 0-5v and DIR on the zs-x11H controller to a pwm pin on Teensy 4.1 for the speed and reverse direction?

On Sun, 8 Oct 2023, 16:07 Az, <azahar...@gmail.com> wrote:
Interesting! I also use hub motors. Here's my github, https://github.com/otomoov/AutoMoveProgram 
I still don't know, what is causing the error. Perhaps redoing https://github.com/linorobot/linorobot2_hardware would solve the issue? Also would you mind sharing picture, video, wiring diagram of your build? I could give a look.

--
You received this message because you are subscribed to the Google Groups "LINOROBOT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linorobot+...@googlegroups.com.
IMG_20231009_215300_158.jpg

Az

unread,
Oct 13, 2023, 2:39:10 PM10/13/23
to LINOROBOT
Hi,

Yes. I connect PWM output from teensy to 0-5v input on the Motor Driver. Since Teensy is a 3.3V controller, I add a lever shiter to change the signal from 3.3V to 5V. I never tried connecting directly, so i don't know what would happen.

For Reversing motor direction (DIR), the  ZS-X11H  I use, required the DIR to be grounded(GND). Therefore, I use IRF520 as a switch. When reverse signal from Teensy received, IRF520 connects DIR to GND, thus reversing the motor. Linorobot have forward & reverse pins for each motor. Pick one that moves the your robot forward and reverse correctly.

So long ZS-X11H receive no signal from Teesny, The motor will not turn and will give some resistant against rotation. This allowed wheel to stop rotating when Teesny stopped giving PWM signal. For example, I face resistance when pushing my linorobot at idle. To push easier, I add a Emergency stop button that will cut-off power supply to the motor drive.

Here's some photos, 
IMG_193618-1.jpgIMG_193213.jpg

Also there's two kind of ZS-X11H,
ZS-X11H_versions.png
ZS-X11H(2) doesn't need a IRF520 because HIGH(1) signal will reverse motor direction unlike ZS-X11H(1) which need LOW(0) to reverse motor.

Here's a video recoding of my build moving.

I hope you share more photos of your robot. And when you are able to run your motor, share a video ecording of it running.

wol aye

unread,
Oct 26, 2023, 8:21:52 AM10/26/23
to Az, LINOROBOT
Hello,
Thanks for always willing to help.
Till date, my project hasn't work yet. I would have sent you pictures, but my project is not as tidy as yours so it might not make sense seeing lots of wires.

When I connected the pwm signal from Teensy to the zs-x11H 0-5v analog input using the bidirectional shifter it didn't work except I turn the potentiometer.

I saw on YouTube that I have to short circuit the jumper pads on the board. After doing that, When I put some codes into Teensy it worked, but the linorobot code to test the motors hasn't yet work.

My question are: 
Did you connect the 0-5v analog input without shorting the pad on the zs-x11H controller? Also, did the analog input work well with pwm?
Did you add a baudrate to the linorobot code for testing motors?
The movement of the Motor while using the potentiometer also came with some strange noise, did you experience such too?
Did you connect the brake as well?

please I would appreciate it if you can give me a step by step guide on how I can connect the systems together to work with linorobot.

Thanks.

You received this message because you are subscribed to a topic in the Google Groups "LINOROBOT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linorobot/elXgKkabJ9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linorobot+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linorobot/f58f6dc5-eda2-4f5d-821b-3aa6df35bd28n%40googlegroups.com.

Az

unread,
Oct 27, 2023, 4:42:19 AM10/27/23
to LINOROBOT
Hello,

1. Yes, I did connect the 0-5v analog input without shorting the pad on the zs-x11H controller. "When PWM input or external potentiometer control, the potentiometer should be adjusted to the minimum (clockwise to increase, counter-clockewise to decrease)". 
2.  For me, Yes. the analog input work well with pwm. In my testing, sending the robot back and forth between two point eg. "Home" & "Goal" resulted in ±10cm deviation. The self-balacing scooter motor is not high precision servo. I use simple method to correct home docking by using simple line follower method with IR sensor and reflective tape.
3. No, I use default Linorobot2 baudrate. Also I don't know about baudrate. I have tried using Arduino Uno to test the zs-x11H controller and it works, shorting or soldering required.
4. I did try setting #define MAX_RPM_RATIO 0.10 and when the robot stop the motor tremble back and forth. I don't know what is the cause. So set 0.40 because default 0.85 is fast for me.
5. No, I did not connect the brake.

Dead Teensy pins, insecure connection could be an issue. Put code into Teensy to test each I/O pin with LEDs and buttons.

For Step by step guide, I'll see what I can do. How soon do you need it?

wol aye

unread,
Nov 9, 2023, 4:17:35 AM11/9/23
to Az, LINOROBOT
Hello,
Thanks for your support.
1) I have been able to confirm that the previous controller I was using wasn't compatible with the system. If I put some code on Teensy, it runs fine but if I send some commands to Teensy, it doesn't work.
2) I connected the ZS-X11H controller based on your directives, it works but the hub motor doesn't stop until I disconnect power from it. Although I haven't connect the other peripherals like the mpu, camera and lidar, I just wanted to test the current stage before moving to another stage.
I also tested with a script from (https://github.com/nassir-malik/BLDC_Hover_Board_Motor_Controller). The script works but mine doesn't stop.
I changed the Teensy to a new one, checked the wiring but the problem still remains the same.
Please do you know how I can resolve this problem?



Az

unread,
Nov 9, 2023, 4:56:01 AM11/9/23
to LINOROBOT
The common cause why motor doesn't stop after spin start is due to teensy unable to read the encoder
It does require linorobot2_hardware, paltformio, screen terminal installed, https://github.com/linorobot/linorobot2_hardware/tree/humble
teensy encoder pins https://github.com/linorobot/linorobot2_hardware/blob/humble/config/lino_base_config.h

//motor 1 (Left)
#define MOTOR1_ENCODER_A 14
#define MOTOR1_ENCODER_B 15 

 #define MOTOR1_PWM 1 //Pin no 21 is not a PWM pin on Teensy 4.x, you can swap it with pin no 1 instead.
 #define MOTOR1_IN_A 20
 #define MOTOR1_IN_B 21 

wol aye

unread,
Nov 9, 2023, 5:01:02 AM11/9/23
to Az, LINOROBOT
Hello,
Thanks for the response.
During the motor check, it spins but it doesn't stop.
Please what can I do to resolve the issue?
Regards,
Alex

Az

unread,
Nov 10, 2023, 8:58:53 PM11/10/23
to LINOROBOT
This is my recording of motor check,
https://youtu.be/AAWDOEjA_S4
It's working ok, no major issue.

It's common to have disconnected wires. Continuity check all connection with mulitmeter. I broke 3 connector because I screw to hard. Twice the wire for motor left disconnected. For this motor check I did dozens of continutity checks.

I did a basic Linorobot2 Humble build,
It's working ok, no major issue.

I've troubleshoot software. The software is fine. What remains are mechanical, electrical, electronics.
Here's a tutorial to check whether the encoder on the motor is working or not.
Do you have option to get another pair of wheel hub motor? if another pair repeated the same problem, it's probably It's an electrical issue. Soldering issue/loose Connection/Missing Pins/etc.

Photos,

IMG_20231111_045549.jpg


wol aye

unread,
Nov 15, 2023, 6:11:34 AM11/15/23
to Az, LINOROBOT
Hello,
Thanks for the feedback.
Please I would like to say that I realised you connected only two wires (one for speed and another for direction) instead of three for BLDC controller configuration. I believe the third wire is used by the sensor for counting the steps made by the wheel. 
If only speed or direction wire  is connected, then the motor would continue to move at a set speed without stopping but if the third wire is connected, it would stop after counting the required amount of steps.
This is my opinion.
Please kindly let me know how you implemented your own. Is it the emergency stop button that makes it stop? If yes, please how did you implement it to move autonomously?

Also, I saw that you used A1 lidar with Ubuntu 22.04. This was a challenge for me at the beginning of installation because A1 lidar seems not to have compatible driver on Ubuntu 22.04, that's why I used Ubuntu 20.04. Please how were you able to resolve this?



--
You received this message because you are subscribed to the Google Groups "LINOROBOT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linorobot+...@googlegroups.com.

Az

unread,
Nov 15, 2023, 4:26:16 PM11/15/23
to LINOROBOT
Hello,

I do not know what you mean by "third wire". I need visuals to know what you are saying. In the motor testing video, the motor spin and stop. The common self-balancing scooter motor have 8 wires:

Thick Wires
  1. Power A
  2. Power B
  3. Power C
Thin wires
  1. 5V (red)  (Required for ZS-X11H)
  2. GND (black)  (Required for ZS-X11H)
  3. Encoder A  (Required for Teensy)
  4. Encoder B  (Required for Teensy)
  5. Encoder C (Not required for Teensy, Required for ZS-X11H)
ZS-X11H_wiring.jpg

motor(1) left
  1. Pwm
  2. Direction (added IRF520 Mosfet to GND DIR)
  3. EncoderA
  4. EncoderB
motor(2) right
  1. Pwm
  2. Direction  (added IRF520 Mosfet to GND DIR)
  3. EncoderA
  4. EncoderB
  5. 5V (to Power IRF520 Mosfet & 3.3V -5V level shifter)
  6. GND  (to GND IRF520 Mosfet & 3.3V -5V level shifter)
Perhaps your ZS-X11H GND is not connected to your Teensy GND?  
ZS-X11H GND( Left & Right ) & Teensy GND need to be connected for DC current to circulate. 

I use the bash script which automatically installed A1 lidar driver,
https://github.com/linorobot/linorobot2#1-robot-computer---linorobot2-package
or you can install driver manually from official github page, https://github.com/Slamtec/sllidar_ros2

I solve it by moving onto Ubuntu 22.04. I had issue with 20.04 plus glactic is EOL. Humble issupported until 2027. 

How to move autonomously? Here's my minimal autonomous program, https://github.com/otomoov/AutoMoveProgram/ 

wol aye

unread,
Nov 27, 2023, 11:57:53 AM11/27/23
to Az, LINOROBOT
Hello,
According to the linorobot config file, we were meant to connect one motor according to the below parameters for ESC_MOTOR_DRIVER.

#define Motor1_Encoder_A 4
#define Motor1_Encoder_B 15

#define Motor1_PWM 1

Please how did you connect these 3 parameters from ZS-X11H controller ?

Did you connect this parameter: #define Motor1_PWM 1  ?

That's what I meant by the third wire.


Message has been deleted

wol aye

unread,
Nov 27, 2023, 11:59:23 PM11/27/23
to Az, LINOROBOT
Hello,
When I said how did you implement the robot to move autonomously.
Please, what I meant was, how were you able to use simple line follower method with IR sensor and reflective tape to regulate the direction of the motor.

wol aye

unread,
Nov 28, 2023, 2:59:54 AM11/28/23
to Az, LINOROBOT
Hello, 
Thanks for the connection diagram. I am beginning to see where the mistake can be.
Please, I can't see the link between Teensy and the Arduino. Is Teensy sending signal to the Arduino? Or how are you referencing the pins on the Arduino?

On Tue, 28 Nov 2023, 00:59 Az, <azahar...@gmail.com> wrote:
It is recommended to ensure that the wheel hub motor's motor encoder is working properly.
Teensy will have issue reading signal from motor if the motor encoder is not working properly.
Here's another reference on how to test wheel hub motor. https://mad-ee.com/controlling-a-hoverboard-motor-with-a-simple-arduino/

#define MOTOR1_ENCODER_A 14
#define MOTOR1_ENCODER_B 15
#define MOTOR1_PWM 1  //PWM
#define MOTOR1_IN_A 20 //DIR Direction
#define MOTOR2_ENCODER_A 11
#define MOTOR2_ENCODER_B 12 
#define MOTOR2_PWM 5  //PWM
#define MOTOR2_IN_A 6  //DIR Direction

Here's my Teensy4.0 and Wheel hub motors wiring sketch,
wheelhubmotor.jpg


Az

unread,
Nov 28, 2023, 10:41:31 PM11/28/23
to LINOROBOT
Correction: 5V could destroy Teensy 4.0 pins. Here's the corrected wiring drawing with Logic Level Shifter.
wheelhubmotor1-2.jpg
Because you share insufficient Photos and Videos, I had to guess what is your issue and problem.

List of things I don't know about your build:
1. Hub Motor Encoder condition
2. Teensy 4.0 condition
3. Motor driver condition
4. Your wiring diagram?
5. Are you using Logic level shifter to insulate Teensy 4.0?
6. Are you using IRF520 mosfet for DIR?

Regarding Autonomous movement, I don't know your python coding proficiency. I recommend you Learn the Basics on https://www.learnpython.org/

wol aye

unread,
Nov 29, 2023, 2:59:25 PM11/29/23
to Az, LINOROBOT
Hello,
Thanks for the support.
In the Linorobot config file, which states uncomment the motor driver you're using as indicated below; please which one did you uncomment or are you using the default: #define USE_GENERIC_2_IN_MOTOR_DRIVER  ?

//uncomment the motor driver you're using
#define USE_GENERIC_2_IN_MOTOR_DRIVER      // Motor drivers with 2 Direction Pins(INA, INB) and 1 PWM(ENABLE) pin ie. L298, L293, VNH5019
// #define USE_GENERIC_1_IN_MOTOR_DRIVER   // Motor drivers with 1 Direction Pin(INA) and 1 PWM(ENABLE) pin.
// #define USE_BTS7960_MOTOR_DRIVER        // BTS7970 Motor Driver
// #define USE_ESC_MOTOR_DRIVER            // Motor ESC for brushless motors


--
You received this message because you are subscribed to the Google Groups "LINOROBOT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linorobot+...@googlegroups.com.

Az

unread,
Nov 29, 2023, 7:29:29 PM11/29/23
to LINOROBOT
Hello,
Here's my lino_base-config.h
I use the default: #define USE_GENERIC_2_IN_MOTOR_DRIVER
lino_base_config.h

wol aye

unread,
Mar 11, 2024, 11:41:40 AMMar 11
to Az, LINOROBOT
Hello Az,
Thanks for the support.
I changed the hub motor,  IRF520 and level shifter, and followed your guide. It worked (please see the video clip).
Please can you provide me with the code and guide on moving the robot to a destination and back to its initial position just like you did your's.
Thanks.

hub motor control.mp4

Az

unread,
Mar 25, 2024, 5:06:30 AMMar 25
to LINOROBOT
Hello,

Here's the code and guide on moving the robot to a destination and back to its initial position,



Reply all
Reply to author
Forward
0 new messages