Welcome to Synthiam!

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

Netherlands
Asked — Edited

Dome Lift Mechanism R2D2

I am trying to convert a system so it can be used in EZ-B/

User-inserted image


The Dome Lift MEchanism by Matthew Zwarts
https://www.thingiverse.com/thing:3654411


The system works with a hbridge that moves the platform up, hit a switch... Do his thing (depending on which lift, servo movement/leds... than reverse the direction of the platform till it hits the lower switch.
Whil going up ... a panel must be opened first and when going down it should close afterwards...

For now the scipt works by pushing a button as trigger....  
Link to script:  https://www.thingiverse.com/download:7006587

Dome lift in action 
https://www.youtube.com/watch?v=oZ7mDE0MupM

Example of lift not exact the same used on R2..
User-inserted image


The system works with a hbridge that moves the platform up, hit a switch... Do his thing (depending on which lift, servo movement/leds...  than reverse the direction of the platform till it hits the lower switch.  
While going up ... a panel must be opened first and when going down the panel should close afterwards... 



User-inserted image

User-inserted image

User-inserted image


Related Hardware EZ-Robot EZ-B v4
Related Control HBridge
AI Support Bot
Related Content
Synthiam
Synthiam
#1  
Hi, that’s a very well documented project. It can be done easily with any ezb. I do have a few questions first. 

iill start with this question. Is the computer located inside the robot or external?
Netherlands
#2  
Wow your always so quick DJ

The mini pc will be in the dome. With some arduinos.
Ez-b is in the body.
Synthiam
#3   — Edited
Okay - that's a great answer because it helps me dial in the suggested solution.

The arduinos can become EZ-B's with firmware. I would recommend using Arduino's connected to the PC via USB. With USB, you don't have to worry about the complications with WiFi interference. It's always concerning when controlling motors by monitoring limit switches via a WiFi connection in case something goes wrong. Specifically in noisy WiFi areas (i.e. conferences)

To move a motor with limit switch, it's quite easy.

1) load ARC

2) press Project -> Add Control 

3) Select the SCRIPTING tab and add a SCRIPT control to the workspace. Or to make the project more concise, add SCRIPT COLLECTION instead

4) Click the Config button on the script 

5) Enter a name for the script, in this example we'll call it "Periscope up"

6) Select the JAVASCRIPT tab, because that's the code we'll write. 

*Notes
1) Notice the EZ-B index # is specified on the commands. They're optional, but i specified them to demonstrate that you can have multiple ezb controllers connected. So if you have three Arduino EZB controllers connected via USB, they can be all accessed in the code.

2) The circuit diagram posted does not have a 4.7k pull-up resistor on the limit switch to +3 or +5 (Depending on controller). Do not rely on the internal pull-up on the arduino because it's not strong enough for lengthy wires and switches, etc.. I always use a real 4.7k pull-up resistor on switches with microcontrollers.

Code example to move periscope UP until limit switch is closed

Code:

// Set hbridge to move periscope up on the ezb #0
Digital.set(d2, true, 0);
Digital.set(d3, false,0);

// Wait for the limit switch to be FALSE (meaning it's been closed)
// Check the value every 100ms on ezb #0
Digital.wait(d22, false, 100, 0);

// Stop the hbridge from moving the periscope
Digital.set(d2, false, 0);
Digital.set(d3, false,0);


ControlCommand()
Now you can call that code from anywhere in your project using the appropriate ControlCommand(). For example, you can add the Speech Recognition control and add the ControlCommand() to execute that script. You can tell the robot to move the periscope that easily. You can also assign that ControlCommand() to a joystick so the buttons will do that. You can also add the ControlCommand() to the camera control so when the robot camera sees different objects, it can move the periscope up.

Other Motors
Repeat this process for all of your motors and their limit switches. 

Moving Motor Down
To have the motors reverse the opposite direction, and use the other limit switch, modify the code. The HBrdige will need the values reversed, and the new limit switch port is needed.

Sounds like a lot, but it's super easy once you perform the first movement:)

When you're done, there will be a number of scripts for each motor (UP/DOWN). And you can execute those scripts from other controls, such as the speech recognition as seen here...

User-inserted image