Wizard creation

julianE

Senior Member
Are there custom wizard creation tools available. For instance, I am playing with the AXE023 motor control board. Works really well but I'd like to have a wizard of sorts that would write the downloadable program from simple instructions i.e. go forward for 1 second, turn left, go forward and so on. I'm thinking I can use visual basic with a simple menu interface or python and just output a text file. I'm sure I can come up with something but why reinvent the wheel if something already exists.

thanks.
 

erco

Senior Member
I'm jealous that Julian has time to play experiment with his new Robot Mesh treasures. I have two of those in a box and I'm sure it will be a year before I have time to try them out!

I'm seriously busy with work, both inventing/licensing products and freelance jobs. There is plenty of simple electronic freelance work available. Mostly simple stuff, sound chips and flashing LEDs. It's dull but steady easy money. There aren't that many vendors doing small jobs like that, the pandemic made many close up shop and/or move away. A surprising problem to have in 2022. I need an intern!
 

julianE

Senior Member
I need to look into electronic freelance work, I had no idea it even existed. I can flash an LED :)
I wish they made an AXE023 type board with a bigger chip, not too difficult to make one on a vero board.
I need to use my free time to learn how to make pc boards.
Glad you are doing well erco even tho it leaves you little time for living.
 

papaof2

Senior Member
Making PC boards at home can be done - I did it for years and still have the Pyrex dish that the etching soultion and boards went into.
PC boards that look good and have solder masks are even easier - use whatever PCB CAD program you're comfortable with to lay out the board and send the files to jlcpcb for processing. I had them make a couple of big double-sided boards (40X2, uMFPU, half-dozen plus other chips, lots of connectors on the board going to sensors). Boards were fine - even the one trace I got wrong (off by one pin with no one to proofread my schematic or board sketch) and I had to cut one trace and jumper that connection. For the first time creating a board that large and that complex, I thought I did OK ;-)
 

steliosm

Senior Member
Julian, will Blockly work for you? I see it has motor and bot specific blocks to work with.

Erco, I want to be your intern! Where do I sign?
 

nick12ab

Senior Member
I've done a bit of searching, and I don't think anyone has done anything with regards to creating new wizards or a platform for 'building' them more easily than using a conventional programming language since I created PICAXE Calculator years ago. This was done using exactly the method you proposed, writing it in Visual Basic.

All the wizards included with PE6 are just standalone executables in the Wizards folder in the installation directory, so you just copy the executable for your wizard into that directory and it will show up in the Wizards drop-down in PE6.

Before you start with writing your own, it might be better to try out some of the other alternatives to Blockly. These include:
  • Scratch
  • The flowcharts in PE6 (use of subroutines might make this close enough to what you want)
  • Yenka (note: the free version is disabled during school hours)
  • Flowol (paid, and seems like just a commercial alternative to the flowcharts in PE6, but it might offer something that PE6 doesn't)

I'm surprised there's no existing software to convert the Logo programming language into code for PICAXE - this would be the perfect solution, and would also go well with the AXE120 Microbot.
 

Flenser

Senior Member
a wizard of sorts that would write the downloadable program from simple instructions i.e. go forward for 1 second, turn left, go forward and so
Blocky appears already able to do what you describe.
In this example the motors run with the last motor command for 500ms. i.e. until the next motor command is issued.

25501

And you can either download the program from within Blocky or use the Blocky convert function to convert your program into basic code:
Code:
'BASIC converted from file:
'D:\Programming\PICAXE\Blocky Examples\LOGO motor commands.xml
'Converted  2022-09-11 at 23:22:59

main:
    low C.1,C.4 : high C.0,C.2
    pause 500
    low C.0,C.4 : high C.1,C.2
    pause 500
    low C.0,C.2 : high C.1,C.4
    pause 500
    low C.1,C.2 : high C.0,C.4
    pause 500
    low C.0,C.1,C.2,C.4
    stop
Full disclosure, I was curious as to how what you describe might be done and I started by looking at what Blocky supported. I've never used Blocky or the AXE023.
 

Flenser

Senior Member
I did think about blockly, i find it very clumsy
It's just occurred to me that you can also do what you'd like in PE using the precompiler.

Using these macros for the syntax forward(500), turnleft(500), etc
Code:
#macro forward(duration)
low C.1,C.4 : high C.0,C.2
pause duration
#endmacro

#macro turnleft(duration)
low C.0,C.4 : high C.1,C.2
pause duration
#endmacro

#macro backward(duration)
low C.0,C.2 : high C.1,C.4
pause duration
#endmacro

#macro turnright(duration)
low C.1,C.2 : high C.0,C.4
pause duration
#endmacro

#macro stop
low C.0,C.1,C.2,C.4
#endmacro

forward(500)
turnleft(500)
backward(500)
turnright(500)
stop
Produces this precompiler output:
Code:
low C.1,C.4 : high C.0,C.2
pause 500
low C.0,C.4 : high C.1,C.2
pause 500
low C.0,C.2 : high C.1,C.4
pause 500
low C.1,C.2 : high C.0,C.4
pause 500
low C.0,C.1,C.2,C.4
or using these #DEFINES for the syntax forward 500, turnleft 500, etc
Code:
#define forward low C.1,C.4 : high C.0,C.2: pause
#define turnleft low C.0,C.4 : high C.1,C.2: pause
#define backward low C.0,C.2 : high C.1,C.4: pause
#define turnright low C.1,C.2 : high C.0,C.4: pause
#define stop low C.0,C.1,C.2,C.4

forward 500
turnleft 500
backward 500
turnright 500
stop
Produces this precompiler output:
Code:
low C.1,C.4 : high C.0,C.2: pause 500
low C.0,C.4 : high C.1,C.2: pause 500
low C.0,C.2 : high C.1,C.4: pause 500
low C.1,C.2 : high C.0,C.4: pause 500
low C.0,C.1,C.2,C.4
Note that the marcro and define definitions above will mean you can't use the PICAXE BASIC commands forward, backward & stop so if this is a problem you'll need to choose different names. e.g. axe023_forward and axe023_stop.

The duration value will also vary depending on the clock frequency as described for the PAUSE command.
 
Last edited:

julianE

Senior Member
It's just occurred to me that you can also do what you'd like in PE using the precompiler.
Many thanks for all the suggestions. I downloaded blockly and will give it a try but I really like the precompiler idea best. I'll need to learn blockly since it's thought in schools.

The AXE23 board is very nice tho 08M2 runs out of ports fast. I finished making a protoboard with a 14M2 and L293D, so far all is working. As far as controlling the speed of motors would it be prudent to PWM the enable pins on L293D or is the better way to PWM each control pin? I ran out of time to test it last night but seems to me that PWM on enable pins would be simplest.

Thanks in advance.
 

erco

Senior Member
Just a heads-up that the L293D is a pretty bad H-bridge. I know that's what we got from the Robot Mesh closeout. But the chip is low-current and wastes power, it will get warm/hot in normal light use. I tried them but I would never use them again. And don't even get me started about 298Ns...

But I do like these MX1508 dual H-bridges, 1.5 A bidirectional. Used to get them for under a buck individually. These days you have to buy 5 to get close to that price: https://www.ebay.com/itm/143790168021

Even better and easier to use (but harder to source) is this Feetech dual motor driver:


 

julianE

Senior Member
thanks Eric, you are absolutely right about the 293, the picaxe module was perfect but the one i built was iffy. it would spin the motors at different speeds depending on the direction. i ended up making a test jig for 293 and the chips varied in the lot i had. out of 5 i tested two were very good and the rest i marked as being spotty. i'll be buying the ones you linked, molte grazie.
 
Top