Shop OBEX P1 Docs P2 Docs Learn Events
Your advice please — Parallax Forums

Your advice please

GMACD53GMACD53 Posts: 10
edited 2018-04-17 05:14 in General Discussion
I am very new to this field but do come from a PLC Ladder Programing / Relay Logic background.
I have written a PLC Ladder Program for a project which I have not built because it required a lot of sensors (some of which are not practical to mount) for a relatively simple task.
I had a hunch that with the right hardware this project could be greatly simplified.
My hunch was half right when I discovered Ping))) Laser sensors in that the hardware aspect is much simpler but Stamp Basic and Blockly are a bit daunting at this stage.
This project involves 4x LaserPing sensors, Microcontroller and 4x Relays for interfacing to another control.
My question is two-fold...
1) Is someone interested in doing this project for me terms negotiable?
Bearing in mind it has commercial potential especially if a corded or wireless remote is added replacing the dumb controller that is being sold today.
2) Failing the above what is the best Microcontroller and what do I need to get this project off the ground.
Note: I am a Mac OS Yosemite user.

I am having an attempt to learn BrocklyProp so please take a look at my Test by GMACD53 and comment...

Any advice greatly appreciated!

Regards

Guy

Comments

  • jmgjmg Posts: 15,140
    GMACD53 wrote: »
    I am very new to this field but do come from a PLC Ladder Programing / Relay Logic background.
    ..... but Stamp Basic and Blockly are a bit daunting at this stage.

    If you have a PLC background, I'm surprised Blocky is daunting ?
    GMACD53 wrote: »
    This project involves 4x LaserPing sensors, Microcontroller and 4x Relays for interfacing to another control.
    That's a bit vague - what is the interface to another controller - is that via relay contacts only ?

    My guess is Blocky supports Laser ping examples, did you try those ?
  • The 4x relays are to add more intelligence to 4x existing relay outputs driving 4x motors.
    The PLC’s I have programmed used Ladder Programming which is nothing like Blockly.
  • PLC Ladder Program
    1920 x 1200 - 100K
    1920 x 1200 - 101K
  • Inputs, Outputs, Timers etc.
    1920 x 1200 - 123K
  • GMACD53,

    Can you write out step by step what you need the program to do and a how everything needs to be hooked up.

    Have you ever used BASIC?
  • GMACD53GMACD53 Posts: 10
    edited 2018-04-16 21:28
    Used Basic a long time ago!

    4x PingLaser sensors to monitor the position of 4x motor driven legs.
    The Microcontroller to control 4x Relays to supply or interrupt power to the motors.
    The supply or interruption depending on...
    Extended Limit reached (Programable)
    Retracted Limit (Programable)
    Platform is level (Programable)
    The Programable aspect with a Parallax 5 position switch...
    When the following are set by driving the legs manually to limit positions then operate switch to set limits...
    SWITCH NOT PRESSED
    Forward/Left = Left Front Retracted Limit
    Forward/Right = Right Front Retracted Limit
    Back/Left = Left Back Retracted Limit
    Back/Right = Right Back Retracted Limit
    SWITCH PRESSED
    Forward/Left/Pressed = Left Front Extended Limit
    Etc Etc
    Centre/Pressed = Platform is Level

    Microcontroller to keep platform level by controlling supply to the motors via 4x relay normally closed contacts.
    This would be done by keeping the legs proportionally in sync relative to their Platform Level position.
    To maintain the platform level the legs must travel the same distance as each other at all times (in practice this will have to have a tolerance built in).
    While the legs are retracting or extending if one is faster than the others then stop it until the others catch up.
    If say both the Left Hand legs ran faster then the platform would not be level side to side so stop until the Right Hand legs catch up.
    Another thing to bear in mind is what tolerance to employ so the motors are not switching too much. I think probably between 5-10 mm?

    The idea is 4 Ping))) sensors will replace 8 limit switches and the need for a level sensor plus it takes care of one leg lifting off the ground by retracting faster than the others which increases the load on the opposite legs.

    My idea is that once the Microcontroller has been told where the limits are and where the legs are when the platform is level it can control the leg motors at their limits or they are out of sync.
    Once a limit is reached then stop driving that leg and stop the others when in sync or their limit reached.
    This stop action should be long enough (5 secs) for the operator to release the retract or extend button connected to the main control. This allows for operation in the opposite direction if required.

    In a nutshell I need to monitor and control 4x motor driven legs for their expanded limit, retracted limit and keep them in sync relative to their Platform Is Level starting point which often has the legs at different lengths.

    I hope this makes sense to you.
  • GMACD53GMACD53 Posts: 10
    edited 2018-04-14 21:21
    The Retracted and Extended Limits need to be programable because the mounting position of the Ping))) Laser sensors may vary and also if a particular height needs to be remembered.
    What distance can these sensors be from the controller?
    Can they be weather proofed and still functional?
  • GMACD53GMACD53 Posts: 10
    edited 2018-04-14 21:18
    Another point is that the first leg to reach either of it’s limits should stop all the other legs (if and when in sync and level).
  • kwinnkwinn Posts: 8,697
    Sounds to me like this would be simpler to do with 4 home switches and 4 optical encoders on the motors. The switches would provide a zero position and the optical encoders would monitor the position of the legs to control the motors.
  • jmgjmg Posts: 15,140
    GMACD53 wrote: »
    The 4x relays are to add more intelligence to 4x existing relay outputs driving 4x motors.
    The PLC’s I have programmed used Ladder Programming which is nothing like Blockly.

    Did you try and get any Blocky program running ?

    eg this one uses Ping sensors (ultrasonic)
    https://learn.parallax.com/tutorials/language/blocklyprop/parking-assist-blocklyprop-project

    The function used, looks to work with either Ping sensor
    https://learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/sensor/ping-distance
  • GMACD53GMACD53 Posts: 10
    edited 2018-04-14 21:32
    Thanks for that.
    Some of it I understand but still not sure if I can design a program for my application from scratch.
    I have not invested in anything yet as I am still trying to determine which way to go and if I am capable.
  • jmgjmg Posts: 15,140
    GMACD53 wrote: »
    Thanks for that.
    Some of it I understand but still not sure if I can design a program for my application from scratch.

    That's why you make it easier, by taking something that already uses the modules you want to use, and modify that :)
    GMACD53 wrote: »
    I have not invested in anything yet as I am still trying to determine which way to go and if I am capable.

    A FLiP module and laser Pin module will not cost a lot.
    You likely need to qualify the laser ping will actually work physically in your application. Being optical, they have some caveats on background & targets.
    eg I recall claims in other threads they do not work well outdoors.
  • Thanks for that.
    I will take a look at the Flip and maybe will have to experiment with a Ping))) Laser.
  • jmgjmg Posts: 15,140
    GMACD53 wrote: »
    Thanks for that.
    I will take a look at the Flip and maybe will have to experiment with a Ping))) Laser.
    FLiP can run many languages, if you find Blocky too chunky, there is C, or PropBASIC, or Spin, or ...

    a relevant example of PropBASIC is
    https://github.com/parallaxinc/PropBASIC/blob/master/example/Ping.pbas
  • GMACD53GMACD53 Posts: 10
    edited 2018-04-14 22:03
    :thumb:
    I do like the FLiP!
  • The book Robotics With The BOE-Bot is what taught me most of what I know about PBASIC.
Sign In or Register to comment.