Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

Tracked Robot - Mobile Controls

Hello Everyone!
New to the platform, please forgive me if these questions have very obvious answers.

I'm incorporating the EZ Platform into a tracked robot.
http://www.thingiverse.com/thing:1240754
The EZ Platform looks like a perfect platform to shoehorn in. (Camera support, mobile support, etc)

I've got the bot built, and it's pretty sweet. (I'll upload a video link soon)

I have some major questions though.

Current Setup:
Motors: 4 5v geared motors (connected 2 in series a side)
Motor Controller: L298 Driver
Brain: IoTiny (Beta)
Battery: 3S Lipo 2200 mAh
Mobile: iPhone 7+


Config:
D0-D3 - Motor Outputs for the L298 (See L298 Truth table)
D4-D5 - Motor PWM for EnA and EnB- Controls Track Speeds

Success!
Using L298 Control with PWM sliders controlling the bot is pretty simple. Keyboard control is crisp, PWM sliders work fine manually. Control is jerky but entirely functional.

Challenges
Mobile Controls! - My Mobile Interface does not present any options for proper touch controls. Having to manually stop both the turn movements and the forward reverse (Toggle) is incredibly cumbersome. I'm sure there's a way to script the buttons with a WhilePressed function (or something similar), but I wasn't able to find it.
Scripting! - Basic tracked robot controls are jerky. Base control for movement isn't analog. Ideally would like to write a differential script for controlling the PWM output for both sides. Example (Basic Idea, Pardon my NEWB arduino code:) )
Define Turnslider = $RightLeftSliderValue
Define Throttle = $UpDownSliderValue
Define Lspeed
Define Rspeed
init loop{
if Turnslider => 55{
int x = 100-Turnslider;
Rspeed = (x/45)*Throttle;
Lspeed = Throttle;
}
elseif Turnslider =< 45{
Lspeed = (Turnslider/45)*Throttle;
Rspeed = Throttle;
}
else{
Lspeed = Throttle
Rspeed = Throttle
}
$PWMLeft = Lspeed
$PWMRight=Rspeed
}

Ultimately I think I just need more experience with scripting with EZ-Builder, but the mobile controls don't seem to lend themselves to manual control in this situation.

Any tips/assistance you can offer would be greatly appreciated!

Thanks!

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
Hi!

Don't worry, people with arduino experience have the most trouble grasping the simplicity of ez-robot because it's, well, easy:D So you can be productive and create something impressive.

ARC uses the concept of MOVEMENT PANELS. A Movement Panel is how your robot knows to how to move. Movement panels can be animated GAIT for humanoids/hexapods or even HBridge. In your case, you want the HBridge PWM Movement panel.

Remove everything you did manually with PWM, because this isn't Arduino and the controls take care of everything for you :D. Here is the HBridge Control you need: http://www.ez-robot.com/Tutorials/Help.aspx?id=192

Now, once you have that working, the EZ-Script commands: Forward(), Left(), Right(), Stop(), Reverse(), etc... will magically work everywhere you use them. That means you can add a speech recognition control and it will just magically start working: http://www.ez-robot.com/Tutorials/Help.aspx?id=90

Or you can add a joystick control and boom, it works: http://www.ez-robot.com/Tutorials/Help.aspx?id=43

Or you can add a mobile interface control and use the Forward(), etc commands on the buttons: http://www.ez-robot.com/Tutorials/Help.aspx?id=196

If you're wanting to add dynamic speed control on the Mobile Interface that you create, simply add Sliders to the mobile interface, one for each track. Edit the code to SetSpeed() or PWM(), which ever you prefer.

Or if add more directional buttons to change the speed
PRO
Synthiam
#2  
Here, i made this for you: TrackRobot.EZB

1) Download and save it

2) Load the project

3) Edit the HBridge control to specify your wires and PWM connections

4) Load it on your phone

*Note: You may wish to adjust the speed of the PWM in each button and the Connection Control's Init Script as i set them all for 255:D

User-inserted image
#4  
DJ Thanks for the reply!

I'm still seeing the controls as toggle buttons (Hence the stop button). This makes finesse control of a tanked bot quite difficult. I was honestly hoping for some sort of analog control, that returns to centre when released.

I can see using the slider for the turn ratio, I just wasn't sure how to have it decide which side to slow down. (Hence the previous if statement)

Any chance I could use a mobile joystick control, or a touch pad or something?

###Update - iOS - H Bridge control works (as toggle buttons) but the custom buttons aren't functioning. Also Clicking on the connection manager (top left) crashes the program.
PRO
Synthiam
#5  
YEah - there's no analog control for mobile yet. Although you can get creative with sliders or the servo pad.

An analog joystick style control is on the Todo list for those wanting to remote control robots.

In the meantime, try out some robot feature. Like speech recognition and camera detection, tracking, etc. That's where the fun begins:D
PRO
Synthiam
#6  
Ensure you have the latest ARC on your mobile device. Old iOS devices may have issues processing the data. Any newer iOS device will be rock solid for processing... although, apple hasn't been on the top of my favorites list these days. Have fun!
PRO
Synthiam
#7  
Oooo, the direction buttons don't work because i uploaded the wrong project when i said i fixed it in a previous response... my bad *stress*! Here's the correct project: TrackRobot.EZB

*Note: i had Speed() instead of SetSpeed() in the direction buttons
#8  
What about accelerometer access on the phone? Is that currently possible? Could tie the pan and tilt of the phone to control the bot. This would be awesome in conjection with the camera on the front of the machine.

Seems overkill for this, but down the road I'll be looking to use something similar to a Google cardboard to control the head of my InMoov. I was really hoping to have a bit more granular access to components.:) (Dream, Create, Excel!)

Do you have a scripting guide or reference doc to assist with code integration? My partner's a comSCI major just itching to push the envelope on the inmoov.

:)
PRO
Synthiam
#9  
Yes - you could do that using the WiiMote control. Although, moving a robot with accelerometer isn't practical imo but give it a shot if you're interested:D

Scripting guides are in the learn section.

There's more than ARC for software, as there's also SDK's and UWP library. You can decide what to use, and they're located in the software section.

ie if you're wanting your own controls, there's plugin ability as well. If you want to add onto the ez-scripting environment, you can do extend the EZ-Script with user defined functions in a plugin. Find more information in the software section.

I recommend spending some time on www.ez-robot.com and take some activites in the tutorials. Experiment a bit and learn the environment with example, etc.. It's a gigantic ecosystem.

There's literally no limit. Have fun!
#10  
Wow DJ, still giving your personal "all" to us. It still impresses me how you get involved with people's issues and questions right down to the level of making demo projects to help us through our process.

Heck, if you're looking for things to do like this I should ask you to download my very complicated B9 project from your cloud. Then go over it to see if I'm over complicating my control process. LOL. ;) I sometime wonder "Is this what DJ would do?". :)
#12  
Repost:

That's what I'm talking about!
Analog sticks, and some pretty serious code interface. I am impressed!

Thank you!