United Kingdom
Asked — Edited
Resolved Resolved by Dunning-Kruger!

Hey Guys Any Way To Convert This Arduino Script Into The Ezb V4 Platform?

There is a company in india making these awesome cheap boards (way cheaper than using sabertooth) that turns dc motors with encoders. Into positional servos.  They have arduino code already and I am wondering if this can be translated into the ezb v4 platform thanks here is the link  https://www.youtube.com/watch?v=kZePOyxjhMY&t=460s Or do we have script templates already for this?

User-inserted image


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#1   — Edited

Are you asking if it can be done or would someone do it for you?... Yes, you can convert that arduino script to ez-script/JavaScript... Whether it would work or not is another story... I know how to do it but you won't learn anything unless you at least take a stab at it yourself... Inside joke... perhaps @EZAng can give you a hand at porting it.... :)

To be honest you can turn any DC motor into a servo (7.4v or less but not sure what size motor you had in mind) by simply removing the electronics and potentiometer out of a cheap hobby servo and using that to control the dc motor... The potentiometer would be attached to the output shaft of the final drive gear... Probably much cheaper and with ARC no coding would be required...

United Kingdom
#2   — Edited

Ahh thank you my humansized android robot is using above 7.4v.

https://www.thingiverse.com/thing:4166931

I have made a EZ panel for it using hbridges. Which fine and the head moves great.

I know by adding a pot to a rotation of a robot joint works. I have read all of the material on here about the subject (really i mean it all of it)

I am guessing if its just serial communication I can just use the sabertooth script and communicate with the board with the commands on there website. When I do the legs and arms for this robot

I will have to have to use bigger DC motors so these boards are fantastic for that only about 12 euros each giving them pinpoint accuracy to any DC motors. taking pots apart is a fiddly process especially if having to be done 20 to 30 times for each motor.

And then its an extra bulk on robot builds to have

User-inserted image

#3   — Edited

Years ago I had written a script that although crude turned a Vex Clawbot arm into a servo with just the vex motor and a vex pot on the output arm shaft... I can't find it now but if I ever do I will post the script... Basically it used the Mapping command in ezscript to "map" the 10bit (1023) Vex pot output to a value between 1 - 180 (for servo positions). As mention, it was very crude but it did work. (proof of concept as it were). This was with the slower first gen ezb4 so it would probably work much better with the much faster ezb4 x/2 version.... You could probably do this using any 5k or 10k potentiometer and any sized motor.... Anyway it probably won't help you with your project but it shows you have options....

PRO
Synthiam
#4  

I think it’s safer to use a tight loop application like this on an Arduino and have the Ez-b instruct it to move.

Let the Arduino do the light lifting of little high priority loops like this. And let the Ez-b do more heavy lifting of sending instructions and such.

That’s what I would do anyway. Although, another option is to use the Ez-b with a usb cable and then you could safely rely on tight loops like this. But again, I’d probably still use a few Arduinos as slave

#5   — Edited

Actually I was just going to mention something like what @DJ said... why not just use the arduino to be the servo controller since you already have the code for it anyway. Then have the ezb4/Arc call the shots? You would need to add something like an interrupt to the arduino so you can send it Control commands from Arc....

United Kingdom
#6  

Ah Cool thank you. So the script is stored on the arduino (slave) And the EZB will just trigger any arduino script. Super nice There is a tutorial on here to talk to an arduino so its pretty straight forward from now on Awesome

United Kingdom
#7   — Edited

Dj Sures

The tutorial was to turn an arduino into an EZB. That is awesome I know a few in the past have asked for this

Could you give an example on how to use an Arduino as a slave and how the ezb triggers any Arduino script?

If you have time Thank you

PRO
USA
#8   — Edited

Hi animator28 , what they are saying is correct.

I don't know how to  use an Arduino as a slave and how the ezb triggers any Arduino script,

But I use the Arduino with the ARC software with many of my projects with servos, makes it EZ :-)

EzAng

PRO
Synthiam
#9  

How many motors do you have to control with the encoder wheel?

also, i do have a slight concern with the encoder wheel as a servo. While it’ll kinda work, there’s going to be a margin of error. And over time, it’ll move out of position. And each time you use it, every encoder wheel servo will need to be recalibrated.

if you could add a potentiometer to each joint, as Richard r pointed out, it’ll be more reliable and easier to use. It’ll decrease setup time as well.

my recommendations for that is to connect a servo pcb to a more powerful hbridge. This gives the hbridge the ability to become a servo.

United Kingdom
#10  

Oh ok

Yea getting out of sync over time is not an option.  Each Motor has the encoder built in

Taking a servo apart and using the board to connect to a pot then the hbridge

You guys are right its just quicker

Thats really cool

I will probably just do that

It seems in robotics there are many different solutions to a problem