Inqling - A Test Mu...
 
Notifications
Clear all

Inqling - A Test Mule

35 Posts
7 Users
12 Likes
3,061 Views
THRandell
(@thrandell)
Brain Donor
Joined: 3 years ago
Posts: 224
 

Posted by: @inq

Although I haven't done a thorough search yet, a quick 10,000 foot view number seemed nearer $8 on Amazon.Β  Seems they're out though.

Β 

Digikey has the 18650 without the solder tab in stock for $6 USD.

https://www.digikey.com/en/products/detail/sparkfun-electronics/PRT-12895/5271298

Β 

Tom

To err is human.
To really foul up, use a computer.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6949
 

@thrandell Solder tab? How would that work in one of these

"https://www.amazon.ca/gp/product/B09LCK17MX/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1"

or

https://www.aliexpress.com/item/1005003343165968.html?spm=a2g0o.order_list.0.0.14a91802Wd74hq

or

" https://www.amazon.ca/Geekworm-Raspberry-X706-Function-Compatible/dp/B096FT6THL/ref=pd_lpo_1?pd_rd_i=B096FT6THL&psc=1 "

EDIT trying to fix amazon links

Β 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @will

I thought it might be so that the heavier base would keep the centre of gravity lower to improve the turning moment while driving the wheels.

But instead, the eyes have it πŸ™‚

Oh!Β  You're serious!Β  I'm used to you keeping my posts from spiraling into boredom... and I appreciate it.

Actually the low CG is even more important than that... the weight has to be low or the robot wouldn't be able to move.Β  Here's a very busy picture trying illustrate what's going on...

  1. The operator sends a drive forward command.
  2. The motors Torque the wheels in the CCW direction (Red Arrow)
  3. The guts (battery, parts, body) feels theΒ Equal and Opposite Moment and get tilting up in the CW direction.Β  (Blue Arrow and Blue body and eyeball)
  4. Because the CG is now raised up, it wants to fall back down due to gravity (Black Arrow) - Just like a pendulum.
  5. The falling back down the low point is what actually makes the wheels turn and move the whole thing forward.

If the CG of all the guts (battery, parts, body) were high up... say at the centerline of the wheel axis, the robot body would just spin around between the wheels and not go anywhere... till it puked.

Disclaimer - There are several other things going on like rotational inertia, so the bot might twitch around a little bit.Β  But talking about that would add a bunch of more arrows to the picture and make everyone want to puke.

Moments

Besides, I have a granddaughter now and it looks cute with the low slung eyes.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2523
 
Posted by: @inq
Posted by: @will

I thought it might be so that the heavier base would keep the centre of gravity lower to improve the turning moment while driving the wheels.

Oh!Β  You're serious!Β  I'm used to you keeping my posts from spiraling into boredom... and I appreciate it.

Occasionally, I get serious "accidentally" πŸ™‚

Actually the low CG is even more important than that... the weight has to be low or the robot wouldn't be able to move.Β  Here's a very busy picture trying illustrate what's going on...

  1. The operator sends a drive forward command.
  2. The motors Torque the wheels in the CCW direction (Red Arrow)
  3. The guts (battery, parts, body) feels theΒ Equal and Opposite Moment and get tilting up in the CW direction.Β  (Blue Arrow and Blue body and eyeball)
  4. Because the CG is now raised up, it wants to fall back down due to gravity (Black Arrow) - Just like a pendulum.

If the CG of all the guts (battery, parts, body) were high up... say at the centerline of the wheel axis, the robot body would just spin around between the wheels and not go anywhere... till it puked.

That's what I said "keep the centre of gravity lower to improve the turning moment while driving the wheels" πŸ™‚ πŸ™‚

*straightens face and lowers voice to serious tone ...*

You'd need to keep the wheels very light for that (since rotational inertia is proportional to the square of the radius), or add some lead fishing weights to the bottom of the "axle". Do you expect to need to use acceleration and deceleration to prevent excessive rocking when making rapid speed changes ?

Anything seems possible when you don't know what you're talking about.


   
Inst-Tech reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2523
 

@inqΒ 

Upon further reflection, it seems to me that adding more weight to the lower part of the axle will just increase the torque required to move (or stop) the mechanism, thereby increasing the tendency to swing the axle out of vertical and worsening the situation.

I'm very interested in how well this structure works in practise. Please keep us aware of your progress.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

High School Physics, maybe Freshman Statics.Β  Sorry for the lesson... maybe someone gained something from it. 😉Β 

Posted by: @will

Do you expect to need to use acceleration and deceleration to prevent excessive rocking when making rapid speed changes ?

Rapid speed changes 🤣 🤣 🤣 - If they were Nema 17s... yes.Β  But these things are SAD!

Top speed 15 rpm.Β  I would have thought with all the gearing, they'd have decent torque.Β  I can easily stop them with my fingers on the shaft...Β  I'm more worried, there's not enough torque to turn these big wheels. -Β  Top speed 20 feet/minute!

Going to use ultra-lite Magnesium ABS Racing Wheels.Β  😋Β 

BBS
Posted by: @will

I'm very interested in how well this structure works in practise. Please keep us aware of your progress.

I may be imaging it, but it seems I remember (decades ago) there being an early proposal for Moon or Mars rover using this concept.Β Β 

Call me Evel Knievel... it'll either fly or crash and burn - in public.Β  I hope to take it to this month's library class next Thursday, but I have a trip this weekend that's slow progress.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2523
 

@inqΒ 

Please don't misunderstand me, I'm not saying it won't work !

That's why I can only look forward to your inevitable success πŸ™‚ Β and why I would would love to know how it turns out. Even just to see how practical it is as a 2 wheel robot base.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Alpha Chassis Assembly

Chassis

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @will

@inqΒ 

Please don't misunderstand me, I'm not saying it won't work !

That's why I can only look forward to your inevitable success πŸ™‚ Β and why I would would love to know how it turns out.Β 

No worries... I takeΒ yourΒ comments as either constructive advice or humor... never negativity.Β Β 

Posted by: @will

Even just to see how practical it is as a 2 wheel robot base.

I can't imagine it having any practical use except chasing mice and frogs.Β  As we mused... any significant weight above the wheel axis... well... will end up below the axis.Β  I'm not quite ready to tackle a balancing robot... at least not with these slow motors.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Alpha Inqling hardware printed and assembled.Β 

Β 

InqlingSmall

Β 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2523
 

@inqΒ 

And is it running ? (Rolling ?) Β (Walking ?) (Limping ?) (Self immolating ?) ...

Anything seems possible when you don't know what you're talking about.


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @will

@inqΒ 

And is it running ? (Rolling ?) Β (Walking ?) (Limping ?) (Self immolating ?) ...

Weebles Wobble, but they don't fall down.Β Β 

I was able to use the Admin GUI to debug and control it.Β  So... I think the server-side code is done.Β  I've started the client side and hope to get it all uploaded to the forum before I head out of town tomorrow.

VBR,Β 

InqΒ Β 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2523
 

@inqΒ 

Excellent ! I hope it works for you.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Alpha Inqling Server Side Code

Here is the Sketch that handles the web server thatΒ will publish the client side GUI.Β  It also handles all the speed controlling duties of the stepper motors and supplying current battery voltage so the client can have a "gas" gauge.

I'm finding the things I want to do on the web development side is a little above my abilities at the moment.Β  I'm new to using HTML canvas controls and I'm having a little difficulty bending them to my will!

I'm heading out of town and won't be working on this, but I wanted to get it out here in case someone was interested or wants to offer some improvements.

VBR,

Inq

#include 
#include 

#define YOUR_SSID "my ssid"
#define YOUR_PW "my password"
#define DEFAULT_HOST_SSID "Inqling"

// By observation, we couldn't send pulses quicker than 1600 uSec
#define MIN_INTERVAL 1600 
// RPM reached when using 1600 interval
#define MAX_RPM 18
#define STEP_PER_REV 2048
#define STOP (u32)-1
#define USEC_PER_MIN 60000000

const u32 Numerator = USEC_PER_MIN / MAX_RPM * 100 / STEP_PER_REV;

InqPortal svr;
Stepper lStep(STEP_PER_REV, D1, D3, D2, D4);   
Stepper rStep(STEP_PER_REV, D5, D7, D6, D8);

// Speeds are -100 to 100... (as in percent)  These are used to 
// calculate the intervals (in micro-seconds) to send a pulse.
s8 lSpeed = 0;              // -100 to 100% Sent by Client
s8 rSpeed = 0;
// Current interval between pulses.
u32 lInterval = STOP;       
u32 rInterval = STOP;
// Micros() of last interval
u32 lLast = 0;              
u32 rLast = 0;

void setup()
{  
    // Turn off AutoSend
    svr.autoSend(0);

    // Publish Voltage and send voltage out every 10 seconds
    svr.publishRO("V", NULL, "Voltage (V)", getVoltage);
    svr.onInterval(sendVoltage, 1000);

    // Stepper Speeds
    svr.publishRW("LS", &lSpeed, "Left Speed (-127 to 127)", NULL, setLeft);
    svr.publishRW("RS", &rSpeed, "Right Speed (-127 to 127)", NULL, setRight);

    svr.begin(DEFAULT_HOST_SSID, NULL, YOUR_SSID, YOUR_PW);
}

float getVoltage()
{
  // Read our voltage - credit to @inst-tech
  return (float)analogRead(A0) * 4.16 / 1024.0;  
}

void sendVoltage(void*)
{
  // Send out our current batter voltage so we can have a "gas" gauge.
  svr.send("lf", "V", getVoltage());
}

void setLeft(s8 speed)
{
  // Callback from Client side to change the speed of the left wheel.
  if (speed == lSpeed)
    return;
  lSpeed = max((s8)-100, min((s8)100, speed));
  if (!lSpeed)      
    return;
  lInterval = Numerator / abs(lSpeed);
  lLast = micros() - lInterval;
}

void setRight(s8 speed)
{
  // Callback from Client side to change the speed of the right wheel.
  if (speed == rSpeed)
    return;
  rSpeed = max((s8)-100, min((s8)100, speed));
  if (!rSpeed)
    return;
  rInterval = Numerator / abs(rSpeed);
  rLast = micros() - rInterval;
}

void loop()
{
  // Our main loop to actually step the motors at the appropriate times.
  u32 now = micros();

  if (lSpeed && (now - lLast > lInterval))
  {
    lStep.step(lSpeed > 0 ? 1 : -1);
    lLast = now;
  }
  if (rSpeed && (now - rLast > rInterval))
  {
    rStep.step(rSpeed > 0 ? 1 : -1);
    rLast = now;
  }
}

Β 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Beta Inqling Server Side Code

Β 

Inqling.inoΒ Β 

Total line count:Β  109 lines - This is the complete code needed to:

  1. Expose the Web Server
  2. Serve the client side application (browser pages)
  3. Expose the Web Socket API to control the Inqling robot.
  4. Send out status messages of motor speeds and battery voltage.

Here is the final server code.Β  About the only differences between this one and the Alpha version are more extensive comments to help explain how things work, and some feedback sent out to clients so when multiple clients are connected, they all get status information indicating what's going on...

#include <InqPortal.h>
#include <Stepper.h>

#define YOUR_SSID "Your SSID"
#define YOUR_PW "Your Password"
#define DEFAULT_HOST_SSID "Inqling"

// By observation, we couldn't send pulses quicker than 1600 uSec
#define MIN_INTERVAL 1600 
// RPM reached when using 1600 interval
#define MAX_RPM 18
#define STEP_PER_REV 2048
#define STOP (u32)-1
#define USEC_PER_MIN 60000000

const u32 Numerator = USEC_PER_MIN / MAX_RPM * 100 / STEP_PER_REV;

InqPortal svr;
Stepper lStep(STEP_PER_REV, D1, D3, D2, D4);   
Stepper rStep(STEP_PER_REV, D5, D7, D6, D8);

// Speeds are -100 to 100... (as in percent)  These are used to 
// calculate the intervals (in micro-seconds) to send a pulse.
s8 lSpeed = 0;              // -100 to 100% Sent by Client
s8 rSpeed = 0;
// Position of the Joystick to feedback to other instances.
s8 x = 0;
s8 y = 0;
// Current interval between pulses.
u32 lInterval = STOP;       
u32 rInterval = STOP;
// Micros() of last interval
u32 lLast = 0;              
u32 rLast = 0;

void setup()
{  
    // Turn off AutoSend
    svr.autoSend(0);

    // Publish Voltage and send voltage out every 10 seconds
    svr.publishRO("V", NULL, "Voltage (V)", getVoltage);
    svr.onInterval(sendVoltage, 1000);

	// Stick position
    svr.publishRW("X", &x, "X");
    svr.publishRW("Y", &y, "Y");

    // Stepper Speeds
    svr.publishRW("LS", &lSpeed, "Left Speed (-100 to 100)", NULL, setLeft);
    svr.publishRW("RS", &rSpeed, "Right Speed (-100 to 100)", NULL, setRight);

    svr.begin(DEFAULT_HOST_SSID, NULL, YOUR_SSID, YOUR_PW);
}

float getVoltage()
{
  // Read our voltage - credit to @inst-tech
  return (float)analogRead(A0) * 4.16 / 1024.0;  
}

void sendVoltage(void*)
{
  // Send out our current batter voltage so we can have a "gas" gauge.
  svr.send("lf", "V", getVoltage());
}

void setLeft(s8 speed)
{
  // Callback from Client side to change the speed of the left wheel.
  if (speed == lSpeed)
    return;
  lSpeed = max((s8)-100, min((s8)100, speed));
  if (!lSpeed)      
    return;
  lInterval = Numerator / abs(lSpeed);
  lLast = micros() - lInterval;
}

void setRight(s8 speed)
{
  // Callback from Client side to change the speed of the right wheel.
  if (speed == rSpeed)
    return;
  rSpeed = max((s8)-100, min((s8)100, speed));
  if (!rSpeed)
    return;
  rInterval = Numerator / abs(rSpeed);
  rLast = micros() - rInterval;
  
  svr.send("ldldldld", "X", x, "Y", y, "LS", lSpeed, "RS", rSpeed);
}

void loop()
{
  // Our main loop to actually step the motors at the appropriate times.
  u32 now = micros();

  if (lSpeed && (now - lLast > lInterval))
  {
    lStep.step(lSpeed > 0 ? 1 : -1);
    lLast = now;
  }
  if (rSpeed && (now - rLast > rInterval))
  {
    rStep.step(rSpeed > 0 ? 1 : -1);
    rLast = now;
  }
}

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Page 2 / 3