Controlling a large motor with a 28X2

Gramps

Senior Member
In what way is it erratic ?
Not sure how to explain it.
With two motors it appears to work correctly , but with one motor on the feedback pot is it over shooting? Perhaps that one second delay we asked for is hindering us.
 

Gramps

Senior Member
Hippy, thank you so much for your help !
Hope to get back to testing your code on the hardware soon.
 

hippy

Technical Support
Staff member
Dare I ask what - which from the photo I'm tempted to call "The All-American Fondler" - is intended to do ?

It's an impressive bit of work.
 

Gramps

Senior Member
- is intended to do ?
The original idea 10 years ago was to build a robot arm and hand that would copy the motion of a human's.
Heading back to America from Mongolia we stopped and stayed with missionary friends in Seoul Korea for a couple months. While there we built our first micro driven animation called Shadow bot.
The arm pictured in our last post is a 3rd generation Shadow bot.
In this time of mandated virus isolation we've had many hours to tinker to our heart's delight!
Now to get everything running smoothly and then incorporate Hippy's code to make this thing come alive!
 
Last edited:

Gramps

Senior Member
Not sure why that would be. You can try this -
Hippy, your code is operating the hardware correctly! The problem we are experiencing is the desired pot is VERY sensitive. It can can only be moved a tiny amount, but the feedback pot does track it faithfully! What would be the best way spread out the desired pot's sweep range?
 

hippy

Technical Support
Staff member
If the pot moved from one extreme to the other turns the motor from its extreme to the other I would guess that what you mean is that a small pot adjustment creates a large movement in the arm.

Not sure what can be done for that because it's like holding a long stick where a small hand movement makes the end of the stick move quite some distance. The only thing I can think of is using a mult-turn pot or to have two pots, coarse and fine.
 

hippy

Technical Support
Staff member
Would using a larger or smaller ohmage pot work?

No; the proportionality of the movement would still be the same.

Or "a divide by 10" line of code applied to the "desired pot" work?

No; that would just stop the pot from reaching the necessary extremes.

Thinking about it; it comes down to needing to increase the resolution. And even a multi-turn pot won't overcome the fact that ADC is 10-bit, with 1024 steps maximum.
 

hippy

Technical Support
Staff member
Looking at the video it seems the two extremes are 90-degree apart when there is usually 270-degrees of pot track available You should adjust the targets and feedback pot mappings so each gives a full 0-1023 reading between extremes.

As to why the arm is moving when the pot is untouched - that's possibly electrical noise, ADC jitter, software bug or hardware issue. You can add SERTXD commands to report what the inputs and output values are to determine what is changing.
 

Gramps

Senior Member
Thank you for your help and the quick response!
We will work on these two issues and report back.

Gramps
 

Gramps

Senior Member
When I change the "Symbol PAUSE_MS " number from 2000 to 1000 the glitch happens each second instead of every 2 seconds.

23850
 

hippy

Technical Support
Staff member
When I change the "Symbol PAUSE_MS " number from 2000 to 1000 the glitch happens each second instead of every 2 seconds.
Looks like pot noise. The pot is deemed to have moved, the arm moves, it pauses for however long, comes back and the pot is different again, the arm moves, it pauses again, ad infinitum.
 

hippy

Technical Support
Staff member
How to do that??
We are back to needing to know what the pot readings are at their extremes, calculating what the transfer mapping is for between those extremes giving a 0-1023 results.

Presumably the earlier values weren't correct and we'll have to go through the earlier process again.

It may however be simpler this time round as it seems the mid-point can be ignored. It will be that which is causing the non-linearity of motion between extremes.
 

Gramps

Senior Member
We are back to needing to know what the pot readings are at their extremes, calculating what the transfer mapping is for between those extremes giving a 0-1023 results.
Thanks hippie, we really appreciate your help with this. I'm going to lay aside the fine-tuning for the moment and just use the program the way it is. Do you see any big problems with running your code on an 08m2?
 

lbenson

Senior Member
Do you see any big problems with running your code on an 08m2?
If you're talking about the code in post 37, how would you plan to map the ports?

Symbol DESIRED_POT = 17 ; C.5 = ADC17
Symbol FEEDBACK_POT = 4 ; C.3 = ADC4
Symbol DIRECTION = C.4
Symbol MOTOR = C.2
 

lbenson

Senior Member
What progress? The simulator is your friend--a few minutes there and you should be able to test it in real life.
 

Gramps

Senior Member
Really buried today but hope to work on this project this evening. Thank you Lance, so much for your help!
 

Gramps

Senior Member
how would you plan to map the ports?
Like this?

Code:
#picaxe 08m2
#no_data

Symbol DESIRED_POT = C.1    ;ADC pin
Symbol FEEDBACK_POT = C.4     ;ADC pin
Symbol DIRECTION = C.0       ; out pin note: remove terminal command
Symbol MOTOR = C.2          ; PWM pin
 

Gramps

Senior Member
Time to program a chip.
YES!😀 it works!
Since the serial output pin is tied up, I can't see what's going on. But we can run the program on the 28X2 and after getting it perfected transfer to the 08M2.
 
Last edited:

Gramps

Senior Member
QUOTE="lbenson, post: 332952, member: 34212"]
I haven't looked into the details, but perhaps this is what you need to control your arm:
[/QUOTE]
This video illustrates what I need but I can't seem to find the product online. Do you have a link?
 

Buzby

Senior Member
It looks to me that the ATOM Matrix device does not actually include the fusion software, you have write your own, or use Annex.

The BNO device includes the fusion algorithm on-board, so it's easily suitable for PICAXE.

I'd like to try one out, but I'm too busy with other stuff to experiment with 'nice to have' devices.

Cheers,

Buzby
 

Gramps

Senior Member
'nice to have' devices.
This looks exactly right for my purpose.
They appear to be around $40 including postage.
There are other ones listed in the $16 range but they're not exactly the same. I wonder if they do the same thing?
 

Gramps

Senior Member
Are these the numbers that I must change in order to get the pot to track correctly?

Symbol FEEDBACK_TOP = 830 ; 3.92V
Symbol FEEDBACK_MID = 512 ; 2.47V
Symbol FEEDBACK_BOT = 216 ; 1.02V
 
Last edited:

Gramps

Senior Member
Look up the BNO055. ( https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor )

It's a 9-DOF gizmo with all the programming taken care of, so you just get three nice clean signals for roll, pitch, and yaw, with velocities as well.
Our new 9 DOF gizmo arrived today!

data sheet address;

Here is our attempt to code what we need to read the "three nice clean signals for roll, pitch, and yaw"
We spent the afternoon really trying to do our homework.

Code:
;Reading the BNO055 9 DOF Absolute Orienation IMU Fusion Breakout board
; SCL connects to C.3
;SDA connects to C.4

#Picaxe 28X2

HSerSetup ???
Pause 1000

i2cslave %0101000, i2cslow, i2cbyte    ; set BNO055 slave address

Symbol hi2cin = 4 ;C.3 SCL pin
Symbol hi2cout = 16 ;C.4 SDA pin

main:    readi2c; read sensor and debug display
    debug
    pause 2000
    goto main
Gramps
 
Last edited:
Top