Robot control with Node-RED

1,098 views
Skip to first unread message

Neil Kolban

unread,
Apr 27, 2016, 1:14:03 PM4/27/16
to Node-RED
I'm about to start a fun project (personal play) using Node-RED and wanted to run it past the community in case others would like to play too and to find out if there is existing collateral in the area.

Like most electronic hobbyists, I want to build me a simple wheeled chassis robot using DC motors.  My plan is to have it controlled via a Raspberry PI.  One of the things I am thinking about is the ability to have it perform a set of instructions.  For example, move forward for 5 seconds, turn left 90 degrees, move forward for 10 seconds etc etc etc.

As I got to thinking about how I might provide those instructions, it struck me that maybe Node-RED would be an ideal solution.  I am imagining a set of robot control nodes wired together with each one comprising a building block of activity ... forward, turn, delay etc etc.  These could either be specific new nodes or composite subflows using existing nodes.  I am planning on using MQTT as the message protocol between my PC (running Node-RED) and the Pi controlling the motors.  The MQTT messages will contain commands such as forward(wheel), backward(wheel), speed(wheel) etc etc...

By wiring nodes together visually, I am imagining a solution to move my robot chassis around.

Any thoughts on this notion?  Is Node-RED a good candidate for such a task?  Is there existent "Robot control" open source software available?

Julian Knight

unread,
Apr 28, 2016, 8:37:35 AM4/28/16
to Node-RED
I think that NR would be an excellent way to play with your robot. :)

Indeed, I think there is a video somewhere of the IBM guys playing with a drone controlled via NR.

The only possible issue is one of power. To run NR, you need a computer capable of running it and that takes a fair bit of power. You could run your robot for a lot longer between charges/battery replacement by using an embedded microcontroller instead of a single board computer. You could still use NR to control the robot but it would be done offboard rather than onboard. That would require wireless comms of course but there are lots of choices for that. Indeed you could use an ESP8266 which is a microcontroller with built-in WiFi - and it has an MQTT library. Note that the cheap robot kits tend to have rather wimpy DC motors that struggle on carpet even when not loaded down with batteries and a Pi! The more weight you put onboard, the more powerful the motors you need - and, of course, the more battery power you need. It is rare to see anyone actually covering the issues of motor power unfortunately so it is hard to calculate.

Either way though, NR is a good way to get started with the programming side of robotics.
Message has been deleted

fadi

unread,
Apr 16, 2018, 4:06:35 AM4/16/18
to Node-RED
I am currently working on a robo project to control it remotely using red nodes

timothym...@gmail.com

unread,
Apr 16, 2018, 12:05:55 PM4/16/18
to Node-RED
I'm also working on a net controlled rover using node red, rasp pi and Arduino mega.  So far I have streaming video from the rasp pi camera, push buttons on the dashboard to control direction and speed, camera pan controls, distance sensors using both Sharp infrareds (on Arduino) and ultrasonic pin sensors (on the PI), battery voltage monitoring on the dashboard using the ADC function of the arduino, and relays to connect and disconnect power from various areas of the robot, such as ESC, battery and lights.  I can kill the separate power to the servos and ESC with the relay, using a relay board driven off the Pi.  This also allows me to reset the Arduino if necessary.

If you want, I'll post up my flows.

For power, I am using separate power sources for the Rasp pi and servo and esc and motors.  The motors require 12 volts, the servos 5 v and the pi 5 v.  The pi being sensitive to low power corrupting the memory, the pi runs off its own 20 amp hour battery.  The motors, servo and esc run off a 14.4 volt lipo source, with a power converter to transform the voltage down to 5 volts for the servos.  I may eventually go NIMH or NICAD for the 12-14 volt power, as lipos are easily damaged by over discharge, and tricky to judge their state of charge.

mohamed elghandor

unread,
Apr 21, 2018, 10:28:30 AM4/21/18
to Node-RED
can you send me the flow

timothym...@gmail.com

unread,
Apr 21, 2018, 10:44:17 AM4/21/18
to Node-RED
Yes, I will post it if I can or as a file.  It around 9 pages long.  It includes the video streaming you are asking about as well.
April 20 2018 robot code.docx
Reply all
Reply to author
Forward
0 new messages