Motor block customization

Technoman

Senior Member
Hi,

Our robots are using B.0/B.1 for the right motor and B.2/B.3 for the left one.

In Blockly, the motor block with arrows can be configured for a specific robot in the pull-down menu but none of them is compatible.
Still, we can use two set motor A/B blocks which are not as easy to handle for our students.

Is there a way to get the "advanced" motor block fitting our needs?
Can we expect being able, one day, to design our own blocks?
 

Technical

Technical Support
Staff member
You can design your own blocks already for use with PE6. Email us your exact requirements and we will show you an example.
 

Technoman

Senior Member
Thanks for your proposal.

Included, informations on our control board (designed for 20M then retrofitted later with 20M2).

Pins B.4 and B.5 were used for an eventual speed control through a small control board, never made as 20M2 was released before. Unfortunately the 20M2 chip has no PWM capability on both pins. These two pins have to be set to 1 in order to get both motors on.
 

Attachments

Technical

Technical Support
Staff member
Please provide a on/off table of all 4 pins for what you want forward/backward/stop/turn left/turn right (of the robot) to be.

For instance if the motors are on opposite sides of the robot you may actually need one motor going forwards and one motor backwards for the robot to physically move forwards (as the motors are 180 degree rotated).
 

Technoman

Senior Member
- stop, forward, backward depend upon a stable activation of outputs.
- turn right, turn left, forward left, forward right, backward left, backward right depend upon the timed activation of outputs.

e.g. : in turn right (90°), both motors are activated for a longer time than in forward right (45°).

Is this timed activation could be implemented within the block?
 

Technical

Technical Support
Staff member
We need a table of the state of all necessary outputs in each of the 9 movements (including stop). So if the user selects forwards (for the robot) which pins are high and which are low?
 

Technoman

Senior Member
Modifying the block in the AXE020 configuration should work :
  • B0 instead of B6
  • B1 instead of B7
  • B2 instead of B5
  • B3 instead of B4
 

Technoman

Senior Member
I found a file named : custom-blocks-readme.txt in C:\ProgramData\Revolution Education\PICAXE Editor\Settings\Blockly\app\js\blockly\blocks. Is it the way to make custom block?

Please, where could I find the motor block to eventuually edit it?
 

Technical

Technical Support
Staff member
You cannot edit the motor block but you can add a custom block. As already requested, we cannot do anything at all until your provide a fully tested table of high/low commands required for each of all the 9 states. Look at the basic output, for instance, of the AXE020 - this will give you 9 lines of basic (one for each direction) such as "low B.5,B.6,B.7 : high B.4". Then modify and test each of the 9 lines to check they work as fully expected (it is easy to get the veer directions wrong, which is why full testing is required).

Then when you have 9 lines let us have them and we can show you the next stage.
 
Top