New features

Support for Dr Simon Monk Raspirobotboard 2

Support for 4Tronix Pizazz Robot Kit

Input handling now responds to short lived events – very useful for Line Following Robots and Burglar Alarms etc

Camera Support courtesy of Matt Venn

Broadcast photo

This will take a photo and stick it in /home/pi/photos using Raspberry Pi camera

Basic Minecraft support

Broadcast MinecraftStart to connect to running Minecraft program

set MineX setMineY and setMineZ followed my MinecraftMove should move you to a the co-ordinates defined

or you can do Broadcast MineCraftCamMove to move the camera to those co-ords instead

Thats all it does so far

Other changes,

ADAFruit and 4Tronix I2C PWM and analogue input boards bow supported at a ll times wit ha ll add-ons

About these ads

12 responses »

  1. Sandra Slutz says:

    Simon, I work for a science education non-profit in the United States. We’re in the process of putting together a Raspberry Pi kit to expose and excite young kids about basic programming and electronics. I’d very much like to talk to you offline if possible. Would it be possible for you to e-mail me? – Sandra

  2. mister-g says:

    We’ve made a light flash on the Pibrella! However, we cannot seem to read the switch. The code has a if loop with
    if sensor value = 1
    RedOn
    1second
    RedOff
    1s
    and back again (obviously this is shortened!)
    Any ideas? Or could we have a dodgy switch? (The sheet with the code used ScratchGPIO 4 if that helps)

  3. Michael says:

    Hi Simon,
    Is there somewhere in the python scratch handler program that I can change the PWM frequency when driving a simple motor (i.e. not a stepper)? A line number would be great.
    The reason I ask is that many years ago I gained experience driving small DC motors with pwm at about 10Hz. The value of this is that the motor gets pulses of full voltage or even more which can keep it turning instead of stalling at low power. I have managed down to about 3 revs/s or ~180 rpm this way. Higher frequency pwm however means the supply just gets averaged / smoothed by all the inductance in the circuit and is therefore just a way of getting a digital to analogue conversion which you can see is not what I want.
    The reason I was using such low frequency in the past by the way is that I was working in basic on a ZX80 using an add-on board to read switches to control power and 10Hz was as fast as I could make it go!
    regards
    Michael

    • cymplecy says:

      Checkout https://github.com/cymplecy/scratch_gpio/blob/V5/sgh_GPIOController.py – line 202 onwards does PWM – PWMFREQ is set to 100Hz.

      it would be great to find an optimum value for it as the low duty cycle motor performance at the moment is quite poor and means I have to use quite high geared motors and then run them an 70-100% duty cycle so getting more torque at lower duty cycles would be great :)

      Good Luck and keep us unpdated :)

      Simon

      • Michael says:

        Hi Simon

        Thanks for that. I tried changing PWMFREQ in line 64 to 10 instaed of 100 and as I write I have a 3V motor fed by a 4.5V supply turning steadily at 12rpm – 5s per rev – on a power setting of 3. It’s a bit notchy but it’s not stalling.
        On the default PWMFREQ setting of 100 I was only able to keep it turning at power 25 – 30 but this is exactly what I was hoping for. The optimum may be a little more than 10 but this is a great start. I hope you find it useful too.
        Funnily enough it’s actually a great visual demonstration of pwm!

        regards
        Michael

      • cymplecy says:

        Great stufff – I’ll have to play with it – I set it at 100 as I use PWM for LED brightness as well and didn’t think that it would affect motors! So I may have to have 2 settings and alter my code to deal with it :)

        regards

        Simon

  4. Michael says:

    PWMFREQ=20 is not a bad compromise. The motor turns slowly but with good torque on low power and then at some power level it begins to run properly at speed. Loading has some effect on this of course. Even at 20 you can see an LED dimming. The flicker is evident at low power/duty cycle but less visible when you go above about 50.
    My next step now is to use a LM293D chip to give me a reversing motor, using the pwm on the enable pin and two other pins as simple high/low to control the direction.
    regards
    Michael

    • cymplecy says:

      I’ve altered the code so that motors are treated differently than LEDS (default 10 Hz for motors) – others on twitter have suggested varying freq with duty cycle so I’m going to play with that – thanks very much for point all this out :)

      Simon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s