Micromelon Robotics
Platform
Resources
NewsAbout UsDownload
Support
Build Your Kit

Stay in the loop

New activities, teaching guides, and product updates delivered to your inbox.

Micromelon Robotics

Australian-made educational robotics for the next generation of innovators.

contact@micromelon.com.au

Company

  • About Us
  • Privacy Policy
  • Terms and Conditions

Products

  • Micromelon Rover
  • Code Editor
  • Robot Simulator
  • Junior
  • Python Library

Support

  • Resources
  • News
  • Rover Repairs
  • Contact
  • Build Your Kit

© 2026 Micromelon Robotics Pty Ltd. All rights reserved.

ABN 56 623 302 296

← Back to Resources
ActivitiesSimulator ActivitiesAdvanced

Activity: Digger and Tipper

Coding Skills

BranchingIterationAlgorithm Design

Rover Concepts

Colour
Activity: Digger and Tipper

Use the digger and tipper attachments together to make your own construction site. Put the digger to work on a pile of material like beads or seeds, and use the tipper to transport it to a new location.

Setup

First, find some grain-like material, for example, jewellery beads or seeds. Then set up a small area with walls on three sides. This area holds the grain, and the digger comes in from the opening to pick up the material. Position the tipper near the pile so the digger can load it. Have the tipper move to a new area outlined by tape and deposit the pile. Change the locations, materials, and number of Rovers to customise your construction site.

Our Approach

Constant: a variable that never changes while the code is running. In Python, we write these in all capitals with underscores between words.

Digger

1Servo Interpolation
  • Servo interpolation is a technique to smooth out servo movements so the digger doesn’t jerk and drop its load.
  • This technique is optional, the normal servo block still works.
  • To use smooth servos, switch to the text editor and copy the code below. Then switch back to blocks if desired.
def slow_servo(Left, Right):
  # This is a function that slowly moves both servos to new positions
  # Right - The new position of the right servo
  # Left - The new position of the left servo
  TIME = 400
  STEP_TIME = 20
  currentPosition = Servos.read()
  lCurrent = currentPosition[0]
  rCurrent = currentPosition[1]
  steps = round(TIME / STEP_TIME)
 
  if currentPosition[0] == Left:
    lCurrent += 1
  if currentPosition[1] == Right:
    rCurrent += 1
 
  lStepSize = steps / (Left - lCurrent)
  rStepSize = steps / (Right - rCurrent)
 
  for i in range(1, steps + 1):
    Servos.setBoth(lCurrent + i / lStepSize, rCurrent + i / rStepSize)
    delay((STEP_TIME / 1000))
2Setting the Digger Constants
  • Set six constants for the digger’s two servos: ARM_DOWN (85), ARM_TIP (10), ARM_UP (0), BUCKET_UP (-20), BUCKET_NEUTRAL (0), and BUCKET_DOWN (-90).
  • The resting position uses BUCKET_NEUTRAL (bucket flat on the ground) and ARM_DOWN (arms flat against the rover).
  • The loading position uses BUCKET_UP (bucket angled to hold items) and ARM_UP (arms raised).
  • The tip position uses BUCKET_DOWN (bucket tipped forward to deposit) and ARM_TIP (arm slightly forward).
  • These values may need tweaking for your specific rover through trial and error.
3Define the Digger Functions
  • Define three functions: up calls slow_servo with BUCKET_UP and ARM_UP, tip calls slow_servo with BUCKET_DOWN and ARM_TIP, and down uses "Set servo degrees" with BUCKET_NEUTRAL and ARM_DOWN.
  • These functions make the code cleaner and easier to understand.
  • You can replace slow_servo with the "Set servo degrees" block if you prefer.
4Prepare the Digger Servos
  • In the main code, call the down function to set the digger to its starting position.
5Make the Digger Routine
  • Design a movement sequence depending on your construction site layout.
  • In our example: move forward 20cm at speed 15 into the pile, back away 1cm at speed 5, call up to raise the arm, back away 10cm at speed 10, turn right 70 degrees towards the tipper, move forward 10cm at speed 15, then call tip to deposit the load.
6Digger Complete Code
  • The full digger program: set constants, define up/tip/down functions, call down to initialise, then execute the movement and loading routine.
  • Note that the slow_servo function is not included in this snippet.

Tipper

7Setting the Tipper Constants
  • Set two constants: TIP_UP (-10) for when the tray is fully tipped, and TIP_REST (90) for the resting position.
8Prepare the Tipper Servo
  • Move the right servo to TIP_REST to set the tipper to its resting position.
9Make the Tipper Routine
  • Design a movement sequence for the tipper after it has been loaded by the digger.
  • In our example: move backward 10cm at speed 10, turn right 80 degrees, move forward 5cm at speed 10, then move the right servo to TIP_UP to tip the load.
10Tipper Complete Code
  • The full tipper program: set TIP_UP and TIP_REST constants, move servo to rest position, execute the movement routine, then tip the load.

Tip: Use the sensors on the Rovers to navigate around the construction site, add tape on the ground for line-following and walls for proximity sensing. Loads don’t have to be grain-like either; try using the digger to load up a Meloncube.

Continue Learning

Activity: Claw AttachmentRelated resourceActivity: Claw AttachmentUse the claw attachment to grab the Meloncube and complete delivery tasks in a warehouse scenario, using the colour sensors to read delivery instructions.

Activity: Forklift AttachmentRelated resourceActivity: Forklift AttachmentUse the forklift attachment to lift and stack Meloncubes into increasingly taller towers, timing the servo precisely to reach each height.

Activity: Seed PlanterRelated resourceActivity: Seed PlanterUse the seed planter attachment to start your own little garden, organise your layout and have the Rover precisely deposit seeds in soft soil.

← Return to Resources