Notifications
Clear all

Pico Robotics Straight Line Motion

17 Posts
4 Users
6 Likes
1,288 Views
THRandell
(@thrandell)
Brain Donor
Joined: 3 years ago
Posts: 223
Topic starter  

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


   
Inq and robotBuilder reacted
Quote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@thrandell

So you are using the pico for robot brains?

Ultimately you have to use some means to reset to the actual pose values of the robot as the errors accumulate to a degree that the pose values are simply too inaccurate to be useful.

 


   
ReplyQuote
THRandell
(@thrandell)
Brain Donor
Joined: 3 years ago
Posts: 223
Topic starter  

@robotbuilder

Yeah, I like programming the Pico.  Its seems very flexible and coding pins for PWM output is a breeze.  More to the point it's only $4 USD!

As I recall with my previous bots I used the wheel encoders mostly to get more accurate turns.  Like when the hider robot spins to face the angle it was bumped on.  I think it was Will that suggested using a beacon to re-calibrate the robot's pose...

 

Tom

P.S.  I became a Grandpa today.  My eldest daughter gave birth to a boy about 3 hours ago 🙂

 

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


   
huckOhio reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@thrandell - Very interesting problem isn't it?  

I thought happily that someone else is going through this same problem as I sat down in the office today to solve this exact same problem for my Inqling Jr robot.  I have one major simplification in that all I have to do is tell the motor to take a well defined digital step.  Even so, it is still a staggeringly difficult (well... maybe just really tedious) problem solving.  The one you have undertaking is at least an order of magnitude more difficult.

I copied your code into an editor just so I could get the color coding and readily read/search it... and I'm not seeing some things I was expecting.  

For instance... setting a PWM duty cycle and/or PWM frequency affects the velocity only indirectly.  In reality, it's more like a throttle on a car... it increases/decreases the torque.  From there, the bot accelerates up to the steady-state speed.  Invariably, the inertia on one side is different than the other and the motors don't exert exactly the same acceleration to even identical PWM settings, one side will get up to speed first and has veered the bot.  Even at speed one motor invariably is different than the other under the same PWM speed... again veering the robot.

I was expecting to find some kind of feedback loop code from the encoders as one reaches a mile-stone and checks to see if the other side did as well.  And the differential being used to throttle the PWM accordingly on the offending side.  And this... is just the beginning as some means of over compensating is necessary to bring the slow one to re-veer the bot on the chosen path.

Then the fun really starts as you code for coordinating turns!

At the very least, I have someone to cry in my beer with. 🤣 😜 

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


   
THRandell reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @robotbuilder

@thrandell

So you are using the pico for robot brains?

Ultimately you have to use some means to reset to the actual pose values of the robot as the errors accumulate to a degree that the pose values are simply too inaccurate to be useful.

 

I know what pose means... does it have a different meaning here?

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
 
Posted by: @thrandell

Tom

P.S.  I became a Grandpa today.  My eldest daughter gave birth to a boy about 3 hours ago 🙂

Ah! congratulations.  I got my first one last year.  

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
Lee G
(@lee-g)
Member
Joined: 3 years ago
Posts: 58
 

@thrandell Congratulations Gramps!! 😀 


   
THRandell reacted
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 
Posted by: @thrandell

P.S.  I became a Grandpa today.  My eldest daughter gave birth to a boy about 3 hours ago 🙂

Although I don't get to see my grandkids (now 3 years and 5 years) very often as they live in another state they are an absolute delight so congrats to all your family.

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 
Posted by: @inq

I know what pose means... does it have a different meaning here?

The position and orientation of the robot in a coordinate frame is known as its pose.

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@inq 

I was expecting to find some kind of feedback loop code from the encoders as one reaches a mile-stone and checks to see if the other side did as well. And this... is just the beginning as some means of over compensating is necessary to bring the slow one to re-veer the bot on the chosen path.

That is what I do. If for example the robot is to travel in a straight line it monitors both encoders and adjusts the pwm so the encoders return the same number of pulses. And as you also alluded to there is the issue of not just adjusting the pwm but actually returning to the path and really you need to feed the encoder values into a function that returns the theoretical current pose of the robot by translating the received encoder pulses into a current direction and position. You should be able to give it a goal position relative to the starting position and let it get there by monitoring the encoders. In other words if you were controlling it yourself by adjusting the pwm using say a joystick the robot should be able to determine where it is and perhaps display it for you.

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@inq 

I have one major simplification in that all I have to do is tell the motor to take a well defined digital step.

Indeed that should make it a lot simpler which is why they are used in printers, printer plotters and some robotic arms for blind pick up and place tasks. If you take your robot off steroids so it moves a bit slower you might just try it on a hard flat surface and see if you can program it to take a complicated path and return back to the same position and direction.

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@thrandell 

@inq  FYI

This would make an ideal swarm bot 🙂

On this site in a video they show it drawing. It doesn't say it uses stepper motors but if it did it should be able to draw some nice mathematical patterns or accurately move around.

https://meetedison.com/edsketch/

 


   
THRandell reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @robotbuilder

And as you also alluded to there is the issue of not just adjusting the pwm but actually returning to the path and really you need to feed the encoder values into a function that returns the theoretical current pose of the robot by translating the received encoder pulses into a current direction and position. You should be able to give it a goal position relative to the starting position and let it get there by monitoring the encoders.

I think I miss-spoke...  TWO ORDERS OF MAGNITUDE!  🤣 😍 I got to hand it to you two and others trying to do this with regular motors, encoders and PWM.  Every time I attempt to wrap my head around all the pitfalls, I simply can't come up with a solution I think will work.

Posted by: @robotbuilder

If you take your robot off steroids so it moves a bit slower you might just try it on a hard flat surface and see if you can program it to take a complicated path and return back to the same position and direction.

Yeah!... the last video of it was way out of control! 😉 And... I've finished having fun with it that way.  Time to get serious about computer controlled versus human controlled movement.

I hope to get out to my test site auditorium tomorrow (if I get this thing coded today) to test my new drive code.  I also have some new stuff to present on the ToF sensor.  Will upload videos from site with good Internet.

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
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

   
ReplyQuote
THRandell
(@thrandell)
Brain Donor
Joined: 3 years ago
Posts: 223
Topic starter  
Posted by: @robotbuilder

You should be able to give it a goal position relative to the starting position and let it get there by monitoring the encoders.

and @inq

Where this conversation is going reminded me of a Dead Reckoning Competition that I saw years ago.  Check it out.  I believe that the winner said that through out the run the robot used trigonometry to re-calculate its return bearing.

Tom

 

 

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


   
ReplyQuote
Page 1 / 2